d: Merge upstream dmd 3982604c5, druntime bc58b1e9, phobos 12329adb6.
[official-gcc.git] / gcc / testsuite / gdc.test / runnable / test21367.d
blob96e8d6c66d1caaade5abc57ce2389dc50200f998
1 // https://issues.dlang.org/show_bug.cgi?id=21367
3 string result = "";
5 struct RCArray(T)
7 T* data;
8 this(this)
10 result ~= "A";
12 ~this()
14 result ~= "B";
18 struct Variant(T...)
20 union
22 T payload;
24 this(this)
26 result ~= "C";
29 ~this()
31 result ~= "D";
35 alias Ft = Variant!(RCArray!double, RCArray!int);
37 void fun(Ft a) {}
38 void main()
40 Ft a;
41 Ft b = a;
44 static ~this()
46 assert(result == "CDD");