Bug 1368 – Default template parameter + template recursion + mixin = segfault

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2007-07-24T06:23:00Z
Last change time
2015-06-09T05:14:59Z
Keywords
ice-on-valid-code
Assigned to
bugzilla
Creator
reiner.pope

Comments

Comment #0 by reiner.pope — 2007-07-24T06:23:31Z
The following code causes a compiler segfault: void main() { mixin Foo!(); } template Foo(uint i = 0) { static if (i == 0) mixin Foo!(i + 1); } Removing the parameter's default value, or turning the mixin in main() into an alias avoids the segfault.
Comment #1 by clugdbug — 2009-04-03T06:08:52Z
No longer segfaults in DMD1.042 and DMD2.027.