Bug 14933 – specifications for the pragma(mangle) are vague

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-08-19T01:18:00Z
Last change time
2015-10-04T18:21:57Z
Assigned to
b2.temp
Creator
b2.temp

Comments

Comment #0 by b2.temp — 2015-08-19T01:18:28Z
The specifications for the way dmd implements pragma(mangle) are too vague. The documentation should specify to which type its symbol is effectively transformed or not: http://dlang.org/pragma.html#mangle see discussion on dlang.lean: http://forum.dlang.org/thread/[email protected]
Comment #1 by b2.temp — 2015-08-19T01:31:21Z
will do, located where restrictions are in dmd: - attrib.c - static unsigned setMangleOverride(Dsymbol *s, char *sym) - else if (s->isFuncDeclaration() || s->isVarDeclaration()){..} https://github.com/9rnsr/dmd/blob/6f3ea9d8809e9ded56499844165d56f7ff9f69a8/src/attrib.c#L810
Comment #2 by k.hara.pg — 2015-08-19T02:24:50Z
`pragma(mangle)` is intended to affect the name of symbols those have linkable data. In plain old "compile and link" model, only functions and variables can have symbol names in link-time (function is a named collection of cpu instructions, and variable is a named data). Templates, template instances, and any user defined types (struct, class, union, and interface) - the scoped symbols in D have no linkable data, because they're just compile-time entity. That's why it affects only functions and variables.
Comment #3 by b2.temp — 2015-08-19T03:12:39Z
Comment #4 by github-bugzilla — 2015-08-19T06:11:06Z
Comment #5 by github-bugzilla — 2015-10-04T18:21:57Z