MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail18719.d
blob7ed513a3dfcb2c9276ccfc36b353ac2640795cff
1 // https://issues.dlang.org/show_bug.cgi?id=18719
3 /*
4 TEST_OUTPUT:
5 ---
6 fail_compilation/fail18719.d(29): Error: immutable field `x` initialized multiple times
7 Previous initialization is here.
8 ---
9 */
11 struct S
13 int x = -1;
14 this(int y) immutable
16 x = y;
17 import core.stdc.stdio;
18 printf("Ctor called with %d\n", y);
20 void opAssign(int) immutable;
23 class C
25 S x;
26 this() immutable
28 this(42); /* Initializes x. */
29 x = 13; /* Breaking immutable, or ok? */
31 this(int x) immutable
33 this.x = x;
37 void main()
39 new immutable C;