Bug 24277 – ImportC: struct initializer entry gets ignored (pt2)

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-12-11T14:45:13Z
Last change time
2024-04-11T09:20:13Z
Keywords
ImportC
Assigned to
No Owner
Creator
Dennis

Comments

Comment #0 by dkorpel — 2023-12-11T14:45:13Z
```C struct S5 { int s; struct { int vis; int count; int id; struct { int symbol; int state; } leaf; }; }; struct S5 s5 = (struct S5) { .s = 10, { .count = 20, .id = 30, .leaf = {.symbol = 40, .state = 50}, } }; int main() { __check(s5.id == 30); __check(s5.leaf.symbol == 40); __check(s5.leaf.state == 50); return 0; } ``` The asserts all fail, and -vcg-ast shows the initializer gets translated to `S5(10, , 20, , )`
Comment #1 by dkorpel — 2024-04-11T09:20:13Z
*** This issue has been marked as a duplicate of issue 24495 ***