Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/fail104.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=76
2 // Using a non-template struct as a template
3 // Compiling leads to "Assertion failure: 's->parent' on line 1694 in file
4 // 'template.c'"
5 /*
6 TEST_OUTPUT:
7 ---
8 fail_compilation/fail104.d(26): Error: template instance `P!()` `P` is not a template declaration, it is a alias
9 fail_compilation/fail104.d(26): Error: mixin `fail104.C!(S).C.T!()` is not defined
10 fail_compilation/fail104.d(31): Error: template instance `fail104.C!(S)` error instantiating
11 ---
12 */
13
14 struct S
15 {
16 template T()
17 {
18 void x(int i)
19 {
20 }
21 }
22 }
23
24 class C(P)
25 {
26 mixin P!().T!();
27 }
28
29 int main(char[][] args)
30 {
31 auto c = new C!(S);
32
33 return 0;
34 }