d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail21547.d
blob7a6a44a4a133ccfbb83767b4af5194523ea9a7e3
1 // https://issues.dlang.org/show_bug.cgi?id=21547
3 /*
4 TEST_OUTPUT:
5 ---
6 fail_compilation/fail21547.d(32): Error: struct `Bar` has constructors, cannot use `{ initializers }`, use `Bar( initializers )` instead
7 fail_compilation/fail21547.d(33): Error: struct `Bar1` has constructors, cannot use `{ initializers }`, use `Bar1( initializers )` instead
8 ---
9 */
11 struct Bar
13 @disable this(int a) {}
14 this(int a, int b) {}
16 string a;
17 uint b;
20 struct Bar1
22 @disable this(int a) {}
23 this(const ref Bar1 o) {}
24 this(int a, int b) {}
26 string a;
27 uint b;
30 void main ()
32 Bar b = { a: "Hello", b: 42 };
33 Bar1 b1 = { a: "Hello", b: 42 };