[Issue 9639] New: Recursive template instanciation segfault dmd

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 3 05:08:14 PST 2013


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

           Summary: Recursive template instanciation segfault dmd
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: deadalnix at gmail.com


--- Comment #0 from deadalnix <deadalnix at gmail.com> 2013-03-03 05:08:13 PST ---
Sample code :
class A {
    this(A) {}
}

class B {
}

typeof(null) foo(alias handler)(A a) {
    handler(a);
    B b;
    return foo!handler(b);
}

typeof(null) foo(alias handler)(B) {
    A a;
    return foo!handler(a);
}

auto bar() {
    A a;

    foo!((stuff) {
        new A(a);
    })(a);
}

Note that foo instantiate itself with the same parameters every time, so it
shouldn't go into infinite recursion.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list