[PATCH] D76323: [AST] Fix handling of long double and bool in __builtin_bit_cast
JF Bastien via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 20 09:44:38 PDT 2020
jfb added a comment.
Maybe you should test `nullptr` as well, given that it's all padding?
================
Comment at: clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp:407
+
+constexpr bool test_bad_bool = bit_cast<bool>('A'); // expected-error {{must be initialized by a constant expression}} expected-note{{in call}}
+
----------------
Sanity-check: `0` and `1` work? IIRC we had a discussion about whether `false` was `0` and `true` was `1`, and we concluded that `false` was indeed `0` but `true` wasn't specified to be `1`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76323/new/
https://reviews.llvm.org/D76323
More information about the cfe-commits
mailing list