gcc/testsuite/gdc.test/fail_compilation/diag13787.d
raw| 1 | // REQUIRED_ARGS: -o- |
| 2 | /* |
| 3 | TEST_OUTPUT: |
| 4 | --- |
| 5 | fail_compilation/diag13787.d(12): Error: cannot slice function pointer `& main` |
| 6 | fail_compilation/diag13787.d(13): Error: cannot index function pointer `& main` |
| 7 | --- |
| 8 | */ |
| 9 | |
| 10 | void main() |
| 11 | { |
| 12 | auto a = (&main)[0..1]; |
| 13 | auto x = (&main)[0]; |
| 14 | } |