http://d.puremagic.com/issues/show_bug.cgi?id=2485
Summary: non-static initialization of struct using static initializer syntax generates wrong code Product: D Version: 1.035 Platform: PC OS/Version: Linux Status: NEW Keywords: wrong-code Severity: normal Priority: P2 Component: DMD AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] The example from the spec added to document that static struct initializer syntax is allowed for non-static initialization doesn't do what it's supposed to with DMD. I've produced a test case from it: struct S { int a; int b; int c; int d = 7; } void test(int i) { S s = { 1, i }; // q.a = 1, q.b = i, q.c = 0, q.d = 7 assert(s.a == 1); assert(s.b == i); assert(s.c == 0); // line 8 assert(s.d == 7); } void main() { test(42); } $ dmd foo.d $ ./foo Error: AssertError Failure foo.d(8) --