mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00
Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318804 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <type_traits>
|
||||
#include "test_macros.h"
|
||||
|
||||
constexpr struct {
|
||||
int x;
|
||||
@@ -137,7 +138,7 @@ int main()
|
||||
// LWG#2837
|
||||
{
|
||||
auto res1 = std::lcm(static_cast<std::int64_t>(1234), INT32_MIN);
|
||||
(void)std::lcm(INT_MIN, 2UL); // this used to trigger UBSAN
|
||||
TEST_IGNORE_NODISCARD std::lcm(INT_MIN, 2UL); // this used to trigger UBSAN
|
||||
static_assert(std::is_same_v<decltype(res1), std::int64_t>, "");
|
||||
assert(res1 == 1324997410816LL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user