Bug 22698 – ImportC: nested struct tag stored in wrong scope
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-01-23T06:16:06Z
Last change time
2022-02-10T10:14:42Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
dave287091
Comments
Comment #0 by dave287091 — 2022-01-23T06:16:06Z
nested struct declarations should be available outside of their containing struct. For example:
// nested.c
struct Bar {
struct Foo {
int x;
} f;
};
struct Foo f = {3}; // nested.c(7): Error: variable `nested.f` no definition of struct `Foo`
I encountered this when trying to compile sqlite with dmd.
Comment #1 by dlang-bot — 2022-01-30T06:30:25Z
@WalterBright created dlang/dmd pull request #13586 "fix Issue 22698 - ImportC: nested struct tag stored in wrong scope" fixing this issue:
- fix Issue 22698 - ImportC: nested struct tag stored in wrong scope
https://github.com/dlang/dmd/pull/13586
Comment #2 by dlang-bot — 2022-01-30T09:20:41Z
dlang/dmd pull request #13586 "fix Issue 22698 - ImportC: nested struct tag stored in wrong scope" was merged into master:
- 541c71bf9539000d02ed7f856772744f2a11eee3 by Walter Bright:
fix Issue 22698 - ImportC: nested struct tag stored in wrong scope
https://github.com/dlang/dmd/pull/13586
Comment #3 by dave287091 — 2022-02-08T08:26:40Z
The above test code still fails to compile with the same error message, even with the above PR.
Comment #4 by bugzilla — 2022-02-10T07:37:44Z
In my defense, the simplified version in the PR did fail, and now succeeds!
Comment #5 by dlang-bot — 2022-02-10T08:21:33Z
@WalterBright created dlang/dmd pull request #13636 "fix Issue 22698 - ImportC: nested struct tag stored in wrong scope" fixing this issue:
- fix Issue 22698 - ImportC: nested struct tag stored in wrong scope
https://github.com/dlang/dmd/pull/13636
Comment #6 by dlang-bot — 2022-02-10T10:14:42Z
dlang/dmd pull request #13636 "fix Issue 22698 - ImportC: nested struct tag stored in wrong scope" was merged into master:
- 8feda6bd123ecd30f706c1454d28dfd06bdf6d9c by Walter Bright:
fix Issue 22698 - ImportC: nested struct tag stored in wrong scope
https://github.com/dlang/dmd/pull/13636