gcc/testsuite/gdc.test/fail_compilation/fail16.d
raw| 1 | // ICE(template.c) in DMD0.080 |
| 2 | /* |
| 3 | TEST_OUTPUT: |
| 4 | --- |
| 5 | fail_compilation/fail16.d(19): Error: function declaration without return type. (Note that constructors are always named `this`) |
| 6 | fail_compilation/fail16.d(19): Error: variable name expected after type `bar!(typeof(X))(X)`, not `;` |
| 7 | --- |
| 8 | */ |
| 9 | |
| 10 | int i; |
| 11 | |
| 12 | template bar(T) |
| 13 | { |
| 14 | void bar(int x) {} |
| 15 | } |
| 16 | |
| 17 | template foo(alias X) |
| 18 | { |
| 19 | bar!(typeof(X))(X); |
| 20 | } |
| 21 | |
| 22 | |
| 23 | void main() |
| 24 | { |
| 25 | foo!(i); |
| 26 | } |