[Issue 1368] New: Default template parameter + template recursion + mixin = segfault

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 24 04:23:32 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1368

           Summary: Default template parameter + template recursion + mixin
                    = segfault
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: reiner.pope at gmail.com


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.


-- 



More information about the Digitalmars-d-bugs mailing list