Bug 11075 – ICE(struct.c) after gagged error in struct field initializer
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-20T11:11:00Z
Last change time
2014-03-23T03:41:11Z
Keywords
ice
Assigned to
nobody
Creator
clugdbug
Comments
Comment #0 by clugdbug — 2013-09-20T11:11:04Z
This is a minor change to fail_compilation/ice9806.d from the test suite.
struct S1() { int x = undefined_expr; }
void test1() {
static assert(!is(typeof(S1!().x)));
static assert(!is(typeof(S1!().x)));
}
---
dmd: struct.c:787: virtual void StructDeclaration::semantic(Scope*): Assertion `type->ty != Tstruct || ((TypeStruct *)type)->sym == this' failed.
Aborted
I found this by enabling full validity checking in CTFE.
Comment #1 by clugdbug — 2013-09-23T00:39:18Z
Bug 11022 is probably a duplicate.
The cause is, that AggregatedDeclaration::semantic2 may encounter errors in initializers, but it doesn't mark the struct as having an error.