struct S { // works with double and long as well real a = 0, b = 0; } void func (S s = S()) { writefln("hello world"); } void main () { func(); } It appears that using "= S()" as a default parameter causes a compiler error if S contains default initializers for types larger than a register (32 bits, e.g. double, real, and long). Full compiler error is "Internal error: ..\ztc\cgcod.c 1594"
This is the same as
This may have the same root cause as bug 2437 and bug 2935. It also applies to D1, at least as far back as 1.020 (but didn't compile at all in 1.010), so not a regression.
The patch in bug 3426 fixes this (they are not the same bug, but are closely related).
Fixed in SVN Repository: http://www.dsource.org/projects/dmd/changeset/230
Fixed dmd 1.051 and 2.036