www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9639] New: Recursive template instanciation segfault dmd

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: deadalnix gmail.com


--- Comment #0 from deadalnix <deadalnix 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: -------
Mar 03 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9639


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com


--- Comment #1 from Walter Bright <bugzilla digitalmars.com> 2013-10-07
00:06:20 PDT ---
Shows up as a stack overflow on dmd for Windows.

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