| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
---- |
| 4 |
fail_compilation/ice14907.d(14): Error: struct `ice14907.S(int v = S)` recursive template expansion |
| 5 |
fail_compilation/ice14907.d(19): while looking for match for `S!()` |
| 6 |
fail_compilation/ice14907.d(15): Error: template `ice14907.f(int v = f)()` recursive template expansion |
| 7 |
fail_compilation/ice14907.d(20): while looking for match for `f!()` |
| 8 |
fail_compilation/ice14907.d(15): Error: template `ice14907.f(int v = f)()` recursive template expansion |
| 9 |
fail_compilation/ice14907.d(21): Error: template `f` is not callable using argument types `!()()` |
| 10 |
fail_compilation/ice14907.d(15): Candidate is: `f(int v = f)()` |
| 11 |
---- |
| 12 |
*/ |
| 13 |
|
| 14 |
struct S(int v = S) {} |
| 15 |
void f(int v = f)() {} |
| 16 |
|
| 17 |
void main() |
| 18 |
{ |
| 19 |
S!() s; // OK <- ICE |
| 20 |
f!()(); // OK <- ICE |
| 21 |
f(); // OK <- ICE |
| 22 |
} |