You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
static_assert(__builtin_bit_cast(int, X{0}) == 0); // both-error {{not an integral constant expression}} \
396
392
// both-note {{bit_cast from a union type is not allowed in a constant expression}}
397
-
#if1
398
393
399
394
structG {
400
395
int g;
@@ -405,19 +400,17 @@ void bad_types() {
405
400
// both-error@+2 {{constexpr variable 'x' must be initialized by a constant expression}}
406
401
// both-note@+1 {{bit_cast to a union type is not allowed in a constant expression}}
407
402
constexpr X x = __builtin_bit_cast(X, G{0});
408
-
#endif
403
+
409
404
structhas_pointer {
410
-
int *ptr; // both-note {{invalid type 'int *' is a member of 'has_pointer'}}
405
+
int *ptr; // both-note 2{{invalid type 'int *' is a member of 'has_pointer'}}
411
406
};
412
407
413
408
constexprintptr_t ptr = __builtin_bit_cast(intptr_t, has_pointer{0}); // both-error {{constexpr variable 'ptr' must be initialized by a constant expression}} \
414
409
// both-note {{bit_cast from a pointer type is not allowed in a constant expression}}
415
410
416
-
#if0
417
-
// expected-error@+2 {{constexpr variable 'hptr' must be initialized by a constant expression}}
418
-
// expected-note@+1 {{bit_cast to a pointer type is not allowed in a constant expression}}
0 commit comments