Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail155.d(20): Error: overlapping initialization for field `x` and `y`
5 fail_compilation/fail155.d(20): `struct` initializers that contain anonymous unions must initialize only the first member of a `union`. All subsequent non-overlapping fields are default initialized
6 ---
7 */
8
9 struct S
10 {
11 int i;
12 union
13 {
14 int x;
15 int y;
16 }
17 int j;
18 }
19
20 S s = S( 1, 2, 3, 4 );