Bug 490 – Static struct initializer without static attribute aborts dmd with assertion
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-11-08T19:17:00Z
Last change time
2014-02-15T13:21:49Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
tom_dlang
Comments
Comment #0 by tom_dlang — 2006-11-08T19:17:02Z
public struct S
{
int a, b;
}
void main() {
S s= {1, 2}; // DMD fails to throw an error and aborts.
S q= {a:1, b:2}; // Idem.
static S r= {1, 2}; // OK.
static S t= {a:1, b:2}; // OK.
}
DMD says:
dmd: init.c:219: virtual Expression* StructInitializer::toExpression(): Assertion `0' failed.
Aborted