mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
29 lines
375 B
D
29 lines
375 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail11355.d(28): Error: struct `fail11355.A` is not copyable because it has a disabled postblit
|
|
---
|
|
*/
|
|
|
|
T move(T)(ref T source)
|
|
{
|
|
return T.init; // Dummy rvalue
|
|
}
|
|
|
|
struct A
|
|
{
|
|
~this() {}
|
|
@disable this(this); // Prevent copying
|
|
}
|
|
|
|
struct B
|
|
{
|
|
A a;
|
|
alias a this;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
B b;
|
|
A a = move(b);
|
|
}
|