gcc/testsuite/gdc.test/fail_compilation/fail19447.d
raw| 1 | /* TEST_OUTPUT: |
| 2 | --- |
| 3 | fail_compilation/fail19447.d(110): Error: static variable `mh` cannot be read at compile time |
| 4 | fail_compilation/fail19447.d(110): called from here: `g19447(mh)` |
| 5 | --- |
| 6 | */ |
| 7 | |
| 8 | #line 100 |
| 9 | |
| 10 | int [2] mh = [1, 2]; |
| 11 | int g19447(ref int[2] a) |
| 12 | { |
| 13 | int[2] b=2; |
| 14 | a=b; |
| 15 | assert(a[0]==2); |
| 16 | return 1; |
| 17 | } |
| 18 | |
| 19 | immutable int i = g19447(mh); |