gcc/testsuite/gdc.test/fail_compilation/fail341.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail341.d(26): Error: struct `fail341.S` is not copyable because field `t` is not copyable |
| 5 | fail_compilation/fail341.d(27): Error: function `fail341.foo` cannot be used because it is annotated with `@disable` |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | struct T |
| 10 | { |
| 11 | @disable this(this) |
| 12 | { |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | struct S |
| 17 | { |
| 18 | T t; |
| 19 | } |
| 20 | |
| 21 | @disable void foo() { } |
| 22 | |
| 23 | void main() |
| 24 | { |
| 25 | S s; |
| 26 | auto t = s; |
| 27 | foo(); |
| 28 | } |