d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / diag13333.d
blob88e8a9d062256e0ea7ce9c4c157d584c7b490523
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/diag13333.d(29): Error: template instance `VariantN!(maxSize!(S), T)` recursive template expansion
5 fail_compilation/diag13333.d(29): Error: template instance `diag13333.maxSize!(S)` error instantiating
6 fail_compilation/diag13333.d(34): instantiated from here: `Algebraic!(S)`
7 ---
8 */
10 template maxSize(T...)
12 static if (T.length == 1)
14 enum size_t maxSize = T[0].sizeof;
16 else
18 enum size_t maxSize = T[0].sizeof >= maxSize!(T[1 .. $])
19 ? T[0].sizeof : maxSize!(T[1 .. $]);
23 struct VariantN(size_t maxDataSize, AllowedTypesX...)
27 template Algebraic(T...)
29 alias Algebraic = VariantN!(maxSize!T, T);
32 struct DummyScope
34 alias A = Algebraic!S;
36 static struct S // <- class
38 A entity;