d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / dbitfields.d
blob0dd1a0bf96e78819087ac0db07862b87aa08123a
1 /* REQUIRED_ARGS: -preview=bitfields
2 * TEST_OUTPUT:
3 ---
4 fail_compilation/dbitfields.d(118): Error: reinterpretation through overlapped field `e` is not allowed in CTFE
5 fail_compilation/dbitfields.d(121): called from here: `testu()`
6 fail_compilation/dbitfields.d(121): while evaluating: `static assert(testu() == 1)`
7 ---
8 */
10 #line 100
12 union U
14 uint a:3;
15 uint b:1;
16 ulong c:64;
18 int d:3;
19 int e:1;
20 long f:64;
22 int i;
25 int testu()
27 U u;
28 u.d = 9;
29 return u.e;
32 static assert(testu() == 1);