[Issue 475] New: DMD segfault on recursive variadic template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 2 10:55:29 PST 2006


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

           Summary: DMD segfault on recursive variadic template
           Product: D
           Version: 0.173
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: korslund at gmail.com


The following code crashes DMD on linux:

template recMove(int i, X...)
{
  void recMove()
    {
      X[i] = X[i+1];
      // I know the code is logically wrong, should test (i+2 < X.length)
      static if(i+1 < X.length) recMove!(i+1, X);
    }
}

void main()
{
  int a, b;
  recMove!(0, a, b);
}


-- 




More information about the Digitalmars-d-bugs mailing list