gcc/testsuite/gdc.test/fail_compilation/diag6707.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/diag6707.d(17): Error: mutable method `diag6707.Foo.value` is not callable using a `const` object |
| 5 | fail_compilation/diag6707.d(13): Consider adding `const` or `inout` here |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | module diag6707; |
| 10 | |
| 11 | struct Foo |
| 12 | { |
| 13 | @property bool value() { return true; } |
| 14 | |
| 15 | void test() const |
| 16 | { |
| 17 | auto x = value; |
| 18 | } |
| 19 | } |