gcc/testsuite/gdc.test/fail_compilation/ice14055.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/ice14055.d(16): Error: uninitialized variable `foo` cannot be returned from CTFE |
| 5 | --- |
| 6 | */ |
| 7 | |
| 8 | struct S |
| 9 | { |
| 10 | static returnsFoo() |
| 11 | { |
| 12 | uint[1] foo = void; |
| 13 | return foo; |
| 14 | } |
| 15 | |
| 16 | static enum fooEnum = returnsFoo(); |
| 17 | static uint[1] fooArray = fooEnum[]; |
| 18 | } |