Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/b19685.d

raw
1 /* TEST_OUTPUT:
2 ---
3 fail_compilation/b19685.d(6): Error: overlapping default initialization for field `b` and `a`
4 ---
5 */
6 struct S
7 {
8 union
9 {
10 struct { int a = 123; }
11 struct { int b = 456; }
12 }
13 }
14
15 void main()
16 {
17 S s;
18 assert(s.b == 123);
19 }