Bug 21965 – importC: Anonymous top-level struct or union triggers [email protected](4787)
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-05-24T14:46:27Z
Last change time
2021-05-28T00:32:47Z
Keywords
ice-on-invalid-code, ImportC, pull
Assigned to
No Owner
Creator
Iain Buclaw
Comments
Comment #0 by ibuclaw — 2021-05-24T14:46:27Z
Similar to issue 21945, but this is for structs and unions that define no instances.
---
struct { int var; };
typedef struct { int var };
---
Both examples produce warnings with a C compiler as they are no-op. It should perhaps be an error with D though, as such declarations are semantically invalid, as per the assertions that it triggers.
Comment #1 by dlang-bot — 2021-05-27T21:44:56Z
@ibuclaw created dlang/dmd pull request #12598 "Add tests for importC issues 21933, 21965, 21968, 21973." fixing this issue:
- fix Issue 21965 - importC: Anonymous top-level struct or union triggers [email protected](4787)
https://github.com/dlang/dmd/pull/12598
Comment #2 by dlang-bot — 2021-05-28T00:32:47Z
dlang/dmd pull request #12598 "Add tests for importC issues 21933, 21965, 21968, 21973." was merged into master:
- a60556a4581ece9b9ad0fbed88c8658ba8924525 by Iain Buclaw:
fix Issue 21965 - importC: Anonymous top-level struct or union triggers [email protected](4787)
https://github.com/dlang/dmd/pull/12598