gcc/testsuite/gdc.test/fail_compilation/fail212.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail212.d(10): Error: function `fail212.baz` without `this` cannot be `const` |
| 5 | fail_compilation/fail212.d(10): did you mean to use `const(int)` as the return type? |
| 6 | fail_compilation/fail212.d(18): Error: function `fail212.S.bar` without `this` cannot be `const` |
| 7 | --- |
| 8 | */ |
| 9 | |
| 10 | const int baz(); |
| 11 | |
| 12 | struct S |
| 13 | { |
| 14 | void foo() const |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | static void bar() const |
| 19 | { |
| 20 | } |
| 21 | } |