gcc/testsuite/gdc.test/fail_compilation/fail46.d
raw| 1 | // PERMUTE_ARGS: -inline |
| 2 | /* |
| 3 | TEST_OUTPUT: |
| 4 | --- |
| 5 | fail_compilation/fail46.d(19): Error: calling non-static function `bug` requires an instance of type `MyStruct` |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | struct MyStruct |
| 10 | { |
| 11 | int bug() |
| 12 | { |
| 13 | return 3; |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | assert(MyStruct.bug() == 3); |
| 20 | return 0; |
| 21 | } |