Bug 22531 – importC: D name mangling applied to forward declaration of function inside function

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-11-21T12:31:42Z
Last change time
2021-12-21T09:15:16Z
Keywords
ImportC, pull, wrong-code
Assigned to
No Owner
Creator
duser

Comments

Comment #0 by duser — 2021-11-21T12:31:42Z
--- int main(void) { void fn(void); fn(); return 0; } void fn(void) { } --- % dmd -run example.c /usr/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: example.o: in function `main': example.c:(.text.main[main]+0x5): undefined reference to `_D2c14mainUZ2fnUZv' collect2: error: ld returned 1 exit status Error: linker exited with status 1 similar bug from "possible duplicates": https://issues.dlang.org/show_bug.cgi?id=15843
Comment #1 by dlang-bot — 2021-12-18T08:14:14Z
@WalterBright created dlang/dmd pull request #13441 "fix Issue 22531 - importC: D name mangling applied to forward declara…" fixing this issue: - fix Issue 22531 - importC: D name mangling applied to forward declaration of function inside function https://github.com/dlang/dmd/pull/13441
Comment #2 by dlang-bot — 2021-12-18T10:50:40Z
dlang/dmd pull request #13441 "fix Issue 22531 - importC: D name mangling applied to forward declara…" was merged into stable: - f0036fe7d13e0c64ae9d2b9886377c07343bdfee by Walter Bright: fix Issue 22531 - importC: D name mangling applied to forward declaration of function inside function https://github.com/dlang/dmd/pull/13441
Comment #3 by dlang-bot — 2021-12-21T09:15:16Z
dlang/dmd pull request #13446 "Move fix for issue 22531 from glue layer to frontend" was merged into stable: - f4ca2f2a26fb81ddbaf8e5626228eb74b54cf5c8 by Martin Kinkelin: Move fix for issue 22531 from glue layer to frontend https://github.com/dlang/dmd/pull/13446