Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/templatethis.d(13): Error: cannot use `this` outside an aggregate type
5 fail_compilation/templatethis.d(17): Error: cannot use `this` outside an aggregate type
6 fail_compilation/templatethis.d(21): Error: cannot use `this` outside an aggregate type
7 fail_compilation/templatethis.d(23): Error: cannot use `this` outside an aggregate type
8 fail_compilation/templatethis.d(29): Error: cannot use `this` outside an aggregate type
9 fail_compilation/templatethis.d(32): Error: mixin `templatethis.t2!()` error instantiating
10 ---
11 */
12
13 template t(this T)
14 {
15 }
16
17 struct S(this T)
18 {
19 }
20
21 enum e(this T) = 1;
22
23 void f(this T)()
24 {
25 }
26
27 mixin template t2()
28 {
29 int i(this T) = 1;
30 }
31
32 mixin t2;
33
34 class C
35 {
36 mixin t2; // OK
37 }