[Issue 11190] New: DMD segfaults in template resolution with "alias this"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 7 10:13:59 PDT 2013


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

           Summary: DMD segfaults in template resolution with "alias this"
           Product: D
           Version: D2
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: blm768 at gmail.com


--- Comment #0 from blm768 at gmail.com 2013-10-07 10:13:58 PDT ---
The following code causes a segfault:

struct SomeStruct(T) {
    T _value;

    //If removed, there is no segfault.
    alias _value this;
}

//If removed or replaced with an actual
//function template, there is no segfault.
template doSomething(T: ulong) {}

void doSomething(T: SomeStruct!T)() {
    assert(false);
}

pragma(msg, doSomething!(SomeStruct!ulong)());

According to GDB:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000562cfd in TypeInstance::deduceType (this=0x8e55d0, sc=0x98b300, 
    tparam=0x8e13c0, parameters=0x8e50a0, dedtypes=0x7fffffffd4c0, 
    wildmatch=0x0) at template.c:3621
3621        TemplateDeclaration *tempdecl =
tempinst->tempdecl->isTemplateDeclaration();

-- 
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