Bug 10832 – ICE on struct template semantic with missing identifier and recursive instantiations

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-16T11:37:00Z
Last change time
2013-11-21T20:09:09Z
Assigned to
nobody
Creator
simen.kjaras

Comments

Comment #0 by simen.kjaras — 2013-08-16T11:37:23Z
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.
Comment #1 by k.hara.pg — 2013-11-21T20:09:09Z
*** This issue has been marked as a duplicate of issue 11075 ***