2 // { dg-do compile { target c++14 } }
4 struct S { unsigned char a : 8, b : 5, c : 3, d, e; unsigned int f : 8, g : 24; };
5 struct T1 { unsigned char a : 1, : 7, b : 5, c : 3, d, e; unsigned int f : 8, g : 24; };
6 struct T2 { unsigned char a : 8, b : 1, : 4, c : 3, d, e; unsigned int f : 8, g : 24; };
7 struct T3 { unsigned char a : 8, b : 5, c : 1, : 2, d, e; unsigned int f : 8, g : 24; };
8 struct T4 { unsigned char a : 8, b : 5, c : 3, d, e; unsigned int f : 1, : 7, g : 24; };
13 T1 t = { 0, 0, 0, 0, 0, 0, 0 };
14 S s = __builtin_bit_cast (S, t);
21 T2 t = { 0, 0, 0, 0, 0, 0, 0 };
22 S s = __builtin_bit_cast (S, t);
29 T3 t = { 0, 0, 0, 0, 0, 0, 0 };
30 S s = __builtin_bit_cast (S, t);
37 T4 t = { 0, 0, 0, 0, 0, 0, 0 };
38 S s = __builtin_bit_cast (S, t); // { dg-error "accessing uninitialized byte" }
45 T1 t = { 0, 0, 0, 0, 0, 0, 0 };
46 S s = __builtin_bit_cast (S, t);
47 unsigned char a = s.a; // { dg-error "accessing uninitialized member" }
54 T2 t = { 0, 0, 0, 0, 0, 0, 0 };
55 S s = __builtin_bit_cast (S, t);
56 unsigned char b = s.b; // { dg-error "accessing uninitialized member" }
63 T3 t = { 0, 0, 0, 0, 0, 0, 0 };
64 S s = __builtin_bit_cast (S, t);
65 unsigned char c = s.c; // { dg-error "accessing uninitialized member" }
69 constexpr bool a = f1 ();
70 constexpr bool b = f2 ();
71 constexpr bool c = f3 ();
72 constexpr bool d = f4 (); // { dg-message "in .constexpr. expansion" }
73 constexpr bool e = f5 (); // { dg-message "in .constexpr. expansion" }
74 constexpr bool f = f6 (); // { dg-message "in .constexpr. expansion" }
75 constexpr bool g = f7 (); // { dg-message "in .constexpr. expansion" }