Bug 22022 – A function with pragma(mangle) mixed into a function body is missing from the binary

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-06-13T10:54:53Z
Last change time
2024-12-13T19:17:02Z
Assigned to
No Owner
Creator
Max Samukha
Moved to GitHub: dmd#19946 →

Comments

Comment #0 by maxsamukha — 2021-06-13T10:54:53Z
mixin template Foo() { pragma(mangle, "bar") extern(C) static void foo() { } } void main() { mixin Foo; } No 'bar' in the generated object. To work around, nest the function in a dummy struct.
Comment #1 by pro.mathias.lang — 2021-06-16T05:30:26Z
Confirmed. Trying to call it from the scope of main also triggers a linker error on OSX. Sounds like a missing override in a visitor.
Comment #2 by robert.schadek — 2024-12-13T19:17:02Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19946 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB