gcc/testsuite/gdc.test/fail_compilation/diag9635.d
raw| 1 | // REQUIRED_ARGS: -m32 |
| 2 | /* |
| 3 | TEST_OUTPUT: |
| 4 | --- |
| 5 | fail_compilation/diag9635.d(17): Error: accessing non-static variable `i` requires an instance of `Foo` |
| 6 | fail_compilation/diag9635.d(18): Error: calling non-static function `foo` requires an instance of type `Foo` |
| 7 | --- |
| 8 | */ |
| 9 | |
| 10 | struct Foo |
| 11 | { |
| 12 | int i; |
| 13 | void foo()() { } |
| 14 | |
| 15 | static void bar() |
| 16 | { |
| 17 | i = 4; |
| 18 | foo(); |
| 19 | } |
| 20 | } |