Bug 22260 – importC: Error: struct `foo.Foo` no size because of forward reference

Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-09-01T04:07:30Z
Last change time
2021-10-18T19:31:41Z
Keywords
ice, ImportC, rejects-valid
Assigned to
No Owner
Creator
dave287091

Comments

Comment #0 by dave287091 — 2021-09-01T04:07:30Z
Given the following C code: struct Foo* foo(void); typedef struct Foo { int x; } Foo; foo.c(1): Error: struct `foo.Foo` no size because of forward reference The compiler then segfaults. Interestingly, changing it to struct Foo* foo(void); struct Foo { int x; } Foo; Has the same behavior.
Comment #1 by dave287091 — 2021-09-28T04:28:27Z
Another case that triggers the same message and ICE: typedef struct Foo Foo; typedef struct Foo { int x; } Foo;
Comment #2 by dave287091 — 2021-10-18T19:31:41Z
*** This issue has been marked as a duplicate of issue 22409 ***