gcc/testsuite/gdc.test/fail_compilation/callconst.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/callconst.d(14): Error: function `func` is not callable using argument types `(const(X))` |
| 5 | fail_compilation/callconst.d(14): cannot pass argument `x` of type `const(X)` to parameter `ref X` |
| 6 | fail_compilation/callconst.d(17): `callconst.func(ref X)` declared here |
| 7 | --- |
| 8 | */ |
| 9 | struct X {} |
| 10 | |
| 11 | void main() |
| 12 | { |
| 13 | auto x = const X(); |
| 14 | func(x); |
| 15 | } |
| 16 | |
| 17 | void func(ref X); |