d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / nestedtempl2.d
blobafc8a29969c283ec467e32f449fe017d5360580f
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/nestedtempl2.d(22): Deprecation: function `nestedtempl2.B.func!(n).func` function requires a dual-context, which is deprecated
5 fail_compilation/nestedtempl2.d(34): instantiated from here: `func!(n)`
6 fail_compilation/nestedtempl2.d(34): Error: `this` is only defined in non-static member functions, not `test`
7 fail_compilation/nestedtempl2.d(34): Error: need `this` of type `B` to call function `func`
8 fail_compilation/nestedtempl2.d(35): Error: `this` is only defined in non-static member functions, not `test`
9 fail_compilation/nestedtempl2.d(35): Error: need `this` of type `B` to make delegate from function `func`
10 fail_compilation/nestedtempl2.d(37): Error: `this` is only defined in non-static member functions, not `test`
11 fail_compilation/nestedtempl2.d(37): Error: need `this` of type `B` needed to `new` nested class `N`
12 ---
15 class B
17 int n;
20 void test()
22 auto func(alias a)()
24 return a;
27 class N(alias a)
31 auto b = new B();
32 b.n = 1;
34 func!(b.n)();
35 auto dg = &func!(b.n);
37 new N!(b.n)();