| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/diag12487.d(15): Error: recursive expansion of template instance `diag12487.recTemplate!int` |
| 5 |
fail_compilation/diag12487.d(25): Error: template instance `diag12487.recTemplate!int` error instantiating |
| 6 |
fail_compilation/diag12487.d(18): Error: function `diag12487.recFunction` CTFE recursion limit exceeded |
| 7 |
fail_compilation/diag12487.d(20): called from here: `recFunction(i)` |
| 8 |
fail_compilation/diag12487.d(18): 1000 recursive calls to function `recFunction` |
| 9 |
fail_compilation/diag12487.d(27): called from here: `recFunction(0)` |
| 10 |
--- |
| 11 |
*/ |
| 12 |
|
| 13 |
template recTemplate(T) |
| 14 |
{ |
| 15 |
enum bool recTemplate = recTemplate!T; |
| 16 |
} |
| 17 |
|
| 18 |
bool recFunction(int i) |
| 19 |
{ |
| 20 |
return recFunction(i); |
| 21 |
} |
| 22 |
|
| 23 |
void main() |
| 24 |
{ |
| 25 |
enum bool value1 = recTemplate!int; |
| 26 |
|
| 27 |
enum bool value2 = recFunction(0); |
| 28 |
} |