Bug 16944 – extern(C++) with template produces wrong mangleof
Status
RESOLVED
Resolution
DUPLICATE
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2016-12-03T01:53:36Z
Last change time
2018-10-22T18:09:32Z
Assigned to
No Owner
Creator
Timothee Cour
Comments
Comment #0 by timothee.cour2 — 2016-12-03T01:53:36Z
originally reported here: http://forum.dlang.org/post/[email protected]:
Not sure what's the difference bw _Z21test_D20161202T141925IiET_S0_ and _Z21test_D20161202T141925IiEii but mangleof produces the one that's not in the library produced:
test.cpp:
```
template<typename T>
T test_D20161202T141925(T a);
template int test_D20161202T141925<int>(int);
```
clang++ -shared -o libtest.so test.cpp
c++filt _Z21test_D20161202T141925IiET_S0_
int test_D20161202T141925<int>(int)
c++filt _Z21test_D20161202T141925IiEii
int test_D20161202T141925<int>(int)
nm libtest.so|grep test_D20161202T141925:
0000000000000ae0 W _Z21test_D20161202T141925IiET_S0_
```
test.d:
```
extern(C++){
void test_D20161202T141743();
T test_D20161202T141925(T)(T a);
}
void test(){
assert(test_D20161202T141925!int.mangleof ==
"_Z21test_D20161202T141925IiEii");
// but I would expect _Z21test_D20161202T141925IiET_S0_ (otherwise,
undefined symbol)
}
```
Comment #1 by pro.mathias.lang — 2018-10-22T18:09:32Z
Duplicate of 16479 (for which there is a pull)
*** This issue has been marked as a duplicate of issue 16479 ***