| 1 |
// https://issues.dlang.org/show_bug.cgi?id=20965 |
| 2 |
// REQUIRED_ARGS: -de |
| 3 |
/* |
| 4 |
TEST_OUTPUT: |
| 5 |
--- |
| 6 |
fail_compilation/fail20965.d(17): Deprecation: `struct S` implicitly-generated postblit hides copy constructor. |
| 7 |
fail_compilation/fail20965.d(17): The field postblit will have priority over the copy constructor. |
| 8 |
fail_compilation/fail20965.d(17): To change this, the postblit should be disabled for `struct S` |
| 9 |
--- |
| 10 |
*/ |
| 11 |
|
| 12 |
struct C |
| 13 |
{ |
| 14 |
this(this) {} |
| 15 |
} |
| 16 |
|
| 17 |
struct S |
| 18 |
{ |
| 19 |
C c; |
| 20 |
@disable this(ref typeof(this)); |
| 21 |
} |
| 22 |
|
| 23 |
void main() |
| 24 |
{ |
| 25 |
S s1; |
| 26 |
auto s2 = s1; // problem |
| 27 |
} |