MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / test16284.d
blob77b73b0db94d5eb3085672419c803cafa55a2215
1 /* REQUIRED_ARGS: -preview=fieldwise
2 TEST_OUTPUT:
3 ---
4 fail_compilation/test16284.d(24): Error: reinterpretation through overlapped field `s` is not allowed in CTFE
5 fail_compilation/test16284.d(27): called from here: `test()`
6 fail_compilation/test16284.d(27): while evaluating: `static assert(test())`
7 ---
8 */
10 // https://issues.dlang.org/show_bug.cgi?id=16284
12 struct S {}
14 struct T
16 union {int i; S s;}
17 this(uint dummy) { s = S.init; }
20 bool test()
22 auto t1 = T(0);
23 auto t2 = T(0);
24 return t1 == t2;
27 static assert(test());