gcc/testsuite/gdc.test/fail_compilation/fail24301.d
raw| 1 | /+ |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail24301.d(19): Error: function `fun` is not callable using argument types `(S)` |
| 5 | fail_compilation/fail24301.d(19): `ref S(ref S)` copy constructor cannot be used because it is annotated with `@disable` |
| 6 | fail_compilation/fail24301.d(14): `fail24301.fun(S __param_0)` declared here |
| 7 | --- |
| 8 | +/ |
| 9 | struct S |
| 10 | { |
| 11 | @disable this(ref S); |
| 12 | } |
| 13 | |
| 14 | @safe void fun(S) {} |
| 15 | |
| 16 | @safe void main() |
| 17 | { |
| 18 | S s; |
| 19 | fun(s); |
| 20 | } |