diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2019-09-23 17:16:55 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2019-09-23 17:16:55 +0000 |
commit | 2d225bbec1a0017ce315b17e0600eddaed306b0e (patch) | |
tree | df050ecd06a6ac595529d46440a656cb1c2fb908 | |
parent | 0a51e1f66dd2fef772cc83c565e4319f0e017a43 (diff) | |
download | bcm5719-llvm-2d225bbec1a0017ce315b17e0600eddaed306b0e.tar.gz bcm5719-llvm-2d225bbec1a0017ce315b17e0600eddaed306b0e.zip |
NFC: Fix a poorly-written test
The author of r364954 foolishly forgot that == binds tighter than ?:
llvm-svn: 372631
-rw-r--r-- | clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp b/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp index 8f4c34744d9..0a12e7eebe4 100644 --- a/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp +++ b/clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp @@ -61,13 +61,13 @@ void test_record() { constexpr int_splicer splice{0x0C05FEFE, 0xCAFEBABE}; - static_assert(bit_cast<unsigned long long>(splice) == LITTLE_END - ? 0xCAFEBABE0C05FEFE - : 0x0C05FEFECAFEBABE); + static_assert(bit_cast<unsigned long long>(splice) == (LITTLE_END + ? 0xCAFEBABE0C05FEFE + : 0x0C05FEFECAFEBABE)); - static_assert(bit_cast<int_splicer>(0xCAFEBABE0C05FEFE).x == LITTLE_END - ? 0x0C05FEFE - : 0xCAFEBABE); + static_assert(bit_cast<int_splicer>(0xCAFEBABE0C05FEFE).x == (LITTLE_END + ? 0x0C05FEFE + : 0xCAFEBABE)); static_assert(round_trip<unsigned long long>(splice)); static_assert(round_trip<long long>(splice)); @@ -220,7 +220,7 @@ void backtrace() { void test_array_fill() { constexpr unsigned char a[4] = {1, 2}; constexpr unsigned int i = bit_cast<unsigned int>(a); - static_assert(i == LITTLE_END ? 0x00000201 : 0x01020000, ""); // expected-warning {{converting the result of '?:' with integer constants to a boolean always evaluates to 'true'}} + static_assert(i == (LITTLE_END ? 0x00000201 : 0x01020000)); } typedef decltype(nullptr) nullptr_t; |