d: Merge upstream dmd, druntime 4ca4140e58, phobos 454dff14d.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / test20719.d
blobb9305f20f80fac4ff7311e1d0c33053cf0249a8b
1 /* TEST_OUTPUT:
2 ---
3 fail_compilation/test20719.d(13): Error: struct `test20719.SumType` no size because of forward reference
4 fail_compilation/test20719.d(32): Error: variable `test20719.isCopyable!(SumType).__lambda2.foo` - size of type `SumType` is invalid
5 fail_compilation/test20719.d(18): Error: template instance `test20719.isCopyable!(SumType)` error instantiating
6 ---
7 */
8 struct SumType
10 alias Types = AliasSeq!(typeof(this));
11 union Storage
13 Types[0] t;
16 Storage storage;
18 static if (isCopyable!(Types[0])) {}
19 static if (isAssignable!(Types[0])) {}
22 alias AliasSeq(TList...) = TList;
24 enum isAssignable(Rhs) = __traits(compiles, lvalueOf = rvalueOf!Rhs);
26 struct __InoutWorkaroundStruct {}
28 T rvalueOf(T)();
30 T lvalueOf()(__InoutWorkaroundStruct);
32 enum isCopyable(S) = { S foo; };