1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail301.d(11): Error: need 'this' for 'guard' of type 'int'
5 fail_compilation/fail301.d(22): Error: template instance fail301.bug3305!0 error instantiating
6 ---
7 */
8 
9 struct bug3305(alias X = 0)
10 {
11     auto guard = bug3305b!(0).guard;
12 }
13 
14 struct bug3305b(alias X = 0)
15 {
16     bug3305!(X) goo;
17     auto guard = 0;
18 }
19 
test()20 void test()
21 {
22     bug3305!(0) a;
23 }
24