Bug 109 – incorrect name mangling for template value arguments
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-04-18T03:15:00Z
Last change time
2014-02-15T13:20:44Z
Assigned to
bugzilla
Creator
thomas-dloop
Comments
Comment #0 by thomas-dloop — 2006-04-18T03:15:01Z
template T (long x){
void T(){
}
}
mixin T!(1);
mixin T!(1u);
mixin T!(1L);
mixin T!(1Lu);
generated symbols:
_D1a9__T1TVi1Z1TFZv
_D1a9__T1TVk1Z1TFZv
_D1a9__T1TVl1Z1TFZv
_D1a9__T1TVm1Z1TFZv
shouldn't all manglings be:
_D1a9__T1TVl1Z1TFZv
While the current mangling doesn't cause bugs in pure D code
it could lead to nasty problems if D and non-D code are
combinded.
Comment #1 by bugzilla — 2006-06-14T18:20:32Z
This is actually how it is intended to work. The idea is to create the name based on what the arguments to the template are *before* coercion to the various specializations and types of the template declaration. This enables the user to add specializations to a template without having to rebuild libraries that also use that template.
It won't generate problems with non-D code, as non-D code won't be instantiating D templates.