Bug 22755 – ImportC: declared symbol must be available in initializer

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-02-10T10:30:27Z
Last change time
2022-02-14T09:13:36Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
dave287091

Comments

Comment #0 by dave287091 — 2022-02-10T10:30:27Z
This common C idiom fails to compile: void* malloc(unsigned long); int main(){ int* p = malloc(sizeof *p); // Error: can only `*` a pointer, not a `void` }
Comment #1 by dave287091 — 2022-02-12T20:11:03Z
The above still fails to compile, but the error message has changed to “undefined identifier `p`”.
Comment #2 by dlang-bot — 2022-02-14T08:20:00Z
@WalterBright created dlang/dmd pull request #13650 "fix Issue 22755 - ImportC: declared symbol must be available in initi…" fixing this issue: - fix Issue 22755 - ImportC: declared symbol must be available in initializer https://github.com/dlang/dmd/pull/13650
Comment #3 by dlang-bot — 2022-02-14T09:13:36Z
dlang/dmd pull request #13650 "fix Issue 22755 - ImportC: declared symbol must be available in initi…" was merged into master: - b206e67847c4db4cb394103d1251743452711251 by Walter Bright: fix Issue 22755 - ImportC: declared symbol must be available in initializer https://github.com/dlang/dmd/pull/13650