Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail336.d(16): Error: struct `S` has constructors, cannot use `{ initializers }`, use `S( initializers )` instead
5 ---
6 */
7
8 // https://issues.dlang.org/show_bug.cgi?id=3476
9 // C-style initializer for structs must be disallowed for structs with a constructor
10 struct S
11 {
12 int a;
13 this(int) {}
14 }
15
16 S s = { 1 };