digitalmars.D.bugs - [Issue 15843] New: D-type mangling used for extern(C) (extern)
- via Digitalmars-d-bugs (28/28) Mar 28 2016 https://issues.dlang.org/show_bug.cgi?id=15843
https://issues.dlang.org/show_bug.cgi?id=15843 Issue ID: 15843 Summary: D-type mangling used for extern(C) (extern) function declaration inside function body, on LDC, GDC, and DMD. Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: lasssafin gmail.com Code: void main() { extern(C) extern int func(int); static assert(func.mangleof == "_D1x4mainFZ4funcUiZi"); } It is mangled as such on all 3 major compilers. Using "pragma(mangle, "func")" as an attribute for func gives: x.d(4): Error: unrecognized pragma(mangle) x.d(6): Error: undefined identifier 'func' x.d(7): Error: undefined identifier 'func' Seemingly, the only user-side fix is moving the declaration out of the function body. --
Mar 28 2016