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:
Billy Robert O'Neal III
2017-11-21 21:37:26 +00:00
parent 10bebe2053
commit 7e250fcdc1
65 changed files with 103 additions and 96 deletions

View File

@@ -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);
}