Summary: | Various errors with static initialization of structs and arrays | ||
---|---|---|---|
Product: | D | Reporter: | David Friedman <dvdfrdmn> |
Component: | dmd | Assignee: | No Owner <nobody> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | bugzilla |
Priority: | P2 | Keywords: | ice-on-valid-code, wrong-code |
Version: | D1 (retired) | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
Test Case 1
Test Case 2 Test Case 3 |
si1.d -- Struct literals do not correctly initialize static arrays in struct declaration. si2.d -- Scalar initializer for static array in struct initializer and struct literals produces too many (and wrong) elements. si3.d -- Structs with zero-length arrays cannot be initialized: dmd: todt.c:146: virtual dt_t* StructInitializer::toDt(): Assertion `sz <= vsz' failed.
Created attachment 155 [details]
Test Case 1
Created attachment 156 [details]
Test Case 2
Created attachment 157 [details]
Test Case 3
si3.d: although the compiler shouldn't issue an assert, a zero length array should have a 0 length initializer.
Fixed dmd 1.046 and 2.031