=====
urxae@urxae:~/tmp$ dmd test.d -c -g
urxae@urxae:~/tmp$ dmd test.d -c -gc
urxae@urxae:~/tmp$ dmd test.d -c -O
urxae@urxae:~/tmp$ dmd test.d -c -g -O
Internal error: ../ztc/cod4.c 357
urxae@urxae:~/tmp$ dmd test.d -c -gc -O
Internal error: ../ztc/cod4.c 357
====
As you can see, both (-g or -gc) and -O must be specified for the error to occur.
The source:
---
void recurse(inout int i) {
int j = i;
recurse(j);
}
---
The argument must be inout, and the argument to the recursive invocation must depend on the value of the original argument. If 'j' is initialized to '0', 'i*0' or similar it compiles fine. If it's initialized to 'i', 'i+1', etc. it errors out.
If the parameter type is a struct (or a pointer to one) and the recursive invocation uses a value derived from a field as parameter it also errors out. (e.g. 'Node* n'/'n.next' or 'Node n'/'*n.next' as formal parameter/argument pair)