Skip to content

Commit a1372cb

Browse files
committed
Add another test case
1 parent 7735172 commit a1372cb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clang/test/AST/ByteCode/builtin-bit-cast.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ namespace simple {
102102
static_assert(check_round_trip<unsigned>((int)0x87654321));
103103
static_assert(check_round_trip<unsigned>((int)0x0C05FEFE));
104104
// static_assert(round_trip<float>((int)0x0C05FEFE));
105+
106+
107+
/// This works in GCC and in the bytecode interpreter, but the current interpreter
108+
/// diagnoses it.
109+
static_assert(__builtin_bit_cast(intptr_t, nullptr) == 0); // ref-error {{not an integral constant expression}} \
110+
// ref-note {{indeterminate value can only initialize an object}}
105111
}
106112

107113
namespace bitint {

0 commit comments

Comments
 (0)