gcc/testsuite/gdc.test/fail_compilation/ice7645.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/ice7645.d(28): Error: accessing non-static variable `t` requires an instance of `C2` |
| 5 | fail_compilation/ice7645.d(31): Error: calling non-static function `fn` requires an instance of type `S2` |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | class C |
| 10 | { |
| 11 | class C2() |
| 12 | { |
| 13 | char t; |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | struct S |
| 18 | { |
| 19 | struct S2(T) |
| 20 | { |
| 21 | void fn() {} |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | void main() |
| 26 | { |
| 27 | C c; |
| 28 | auto v = c.C2!().t; |
| 29 | |
| 30 | S s; |
| 31 | s.S2!int.fn(); |
| 32 | } |