gcc/testsuite/gdc.test/fail_compilation/test21927.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=21927 |
| 2 | /* |
| 3 | TEST_OUTPUT: |
| 4 | --- |
| 5 | fail_compilation/test21927.d(17): Error: invalid `foreach` aggregate `this.T2(Args2...)` of type `void` |
| 6 | fail_compilation/test21927.d(18): Error: invalid `foreach` aggregate `this.T2!()` of type `void` |
| 7 | --- |
| 8 | */ |
| 9 | |
| 10 | struct S |
| 11 | { |
| 12 | template T2(Args2...) {} |
| 13 | |
| 14 | void fun() |
| 15 | { |
| 16 | // original test case |
| 17 | static foreach (p; this.T2) {} // ICE |
| 18 | static foreach (p; this.T2!()) {} // ICE |
| 19 | } |
| 20 | } |