[Issue 22021] pragma(mangle) not accepted in function body
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jun 14 16:15:16 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22021
kinke <kinke at gmx.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kinke at gmx.net
--- Comment #1 from kinke <kinke at gmx.net> ---
I'm not sure this should work - `extern(<lang>)` doesn't affect the mangling of
nested functions either, only ABI/calling convention. The reason is simple,
nested functions are D only, and the D mangling makes sure there are no
duplicates/conflicts (as it includes the parent function(s)).
The IMO more intuitive workaround is a freestanding function. Exposing a nested
D function for consumption from C[++] is probably not very common; I guess the
main usage would be consuming an external function from D, and declaring it as
nested function in D for locality.
--
More information about the Digitalmars-d-bugs
mailing list