d: Merge upstream dmd ff57fec515, druntime ff57fec515, phobos 17bafda79.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / const_ctor.d
blobae37023f0a10b985d6c38ef8d0b82b52e4fa074b
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/const_ctor.d(23): Error: `const` copy constructor `const_ctor.S1.this` cannot construct a mutable object
5 fail_compilation/const_ctor.d(25): Error: `const` constructor `const_ctor.S2.this` cannot construct a mutable object
6 ---
7 */
9 struct S1
11 this(ref const S1 s) const {}
12 int* i;
14 struct S2
16 this(int) const {}
17 int* i;
20 void main()
22 const(S1) s1;
23 S1 m1 = s1;
25 S2 s2 = S2(5);