gcc/testsuite/gdc.test/fail_compilation/immutable_ctor.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/immutable_ctor.d(18): Error: `immutable` copy constructor `immutable_ctor.S1.this` cannot construct a mutable object |
| 5 | --- |
| 6 | */ |
| 7 | |
| 8 | struct S1 |
| 9 | { |
| 10 | this(ref const S1 s) immutable { |
| 11 | } |
| 12 | int i; |
| 13 | } |
| 14 | |
| 15 | void main() |
| 16 | { |
| 17 | const(S1) s1; |
| 18 | S1 ms1 = s1; |
| 19 | } |