gcc/testsuite/gdc.test/fail_compilation/fail92.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail92.d(15): Error: invalid `foreach` aggregate `t` of type `typeof(null)` |
| 5 | fail_compilation/fail92.d(23): Error: template instance `fail92.crash!(typeof(null))` error instantiating |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | // [25] |
| 10 | |
| 11 | template crash(T) |
| 12 | { |
| 13 | void crash(T t) |
| 14 | { |
| 15 | foreach (u; t) |
| 16 | { |
| 17 | } |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | void main() |
| 22 | { |
| 23 | crash(null); |
| 24 | } |