www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10832] New: ICE on struct template semantic with missing identifier and recursive instantiations

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

           Summary: ICE on struct template semantic with missing
                    identifier and recursive instantiations
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: simen.kjaras gmail.com


--- Comment #0 from Simen Kjaeraas <simen.kjaras gmail.com> 2013-08-16 11:37:23
PDT ---
struct Foo(int x) {
    auto bar() {
        auto a = is(Foo!3) == is(Foo!3);
        Nonexistent();
    }
}

void main( ) {
    Foo!2 a;
}


The above program crashes the compiler with this message:

assert struct.c(791) type->ty != Tstruct || ((TypeStruct *)type)->sym == this

(that's in StructDeclaration::semantic, btw)

Changing the template instantiations inside bar() to equal that in main()
causes the problem to disappear. Thus it seems the problem is caused by a
template that's not fully analyzed yet.

Removing one of the isExpressions fixes the problem. Using __traits(compiles,
{Foo!3 f;}) in place of (one or both) the isExpressions causes the same
problem.

Removing the call to Nonexistent() fixes the problem.

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