gcc/testsuite/gdc.test/fail_compilation/fail9346.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail9346.d(26): Error: struct `fail9346.S` is not copyable because it has a disabled postblit |
| 5 | fail_compilation/fail9346.d(27): Error: struct `fail9346.S` is not copyable because it has a disabled postblit |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | struct S |
| 10 | { |
| 11 | @disable this(this); |
| 12 | } |
| 13 | struct SS1 |
| 14 | { |
| 15 | S s; |
| 16 | } |
| 17 | struct SS2 |
| 18 | { |
| 19 | S s; |
| 20 | this(this){} |
| 21 | } |
| 22 | |
| 23 | void main() |
| 24 | { |
| 25 | S s; |
| 26 | SS1 ss1 = SS1(s); |
| 27 | SS2 ss2 = SS2(s); |
| 28 | } |