tbaederr wrote:
The change itself looks fine to me, but it can lead to some weird diagnostics:
```c++
#define fold(x) (__builtin_constant_p(x) ? (x) : (x))
constexpr long fn(void) {
return __builtin_bit_cast(long, fold((long)&fn));
}
static_assert(fn() == 1);
```
```console
array.cpp:714:15: error: static assertion expression is not an integral
constant expression
714 | static_assert(fn() == 1);
| ^~~~~~~~~
array.cpp:711:10: note: constexpr bit cast involving type 'long' is not yet
supported
711 | return __builtin_bit_cast(long, fold((long)&fn));
| ^
array.cpp:714:15: note: in call to 'fn()'
714 | static_assert(fn() == 1);
| ^~~~
```
but that's more a pre-existing problem and not introduced by this patch.
https://github.com/llvm/llvm-project/pull/184865
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits