2 // { dg-do compile { target c++14 } }
4 struct S { unsigned char a[2]; alignas(sizeof 0) int b; };
5 struct T { char a; alignas(sizeof 0) int b; };
6 struct U { char a : 1; char : 6; char b : 1; };
7 struct V { int a; S b; };
8 struct W { unsigned a; T b; };
14 S s = __builtin_bit_cast (S, t);
22 unsigned char a = __builtin_bit_cast (unsigned char, u);
30 S s = __builtin_bit_cast (S, t);
31 return s.a[1] == 0; // { dg-error "accessing uninitialized array element" }
38 unsigned char a = __builtin_bit_cast (unsigned char, u);
39 return a == 0; // { dg-error "is not a constant expression" }
46 V s = __builtin_bit_cast (V, t);
54 V s = __builtin_bit_cast (V, t);
55 return s.b.a[1] == 1; // { dg-error "accessing uninitialized array element" }
58 constexpr bool a = f1 ();
59 constexpr bool b = f2 ();
60 constexpr bool c = f3 (); // { dg-message "in .constexpr. expansion" }
61 constexpr bool d = f4 (); // { dg-message "in .constexpr. expansion" }
62 constexpr bool e = f5 ();
63 constexpr bool f = f6 (); // { dg-message "in .constexpr. expansion" }