Bug 20685 – Missing const in name mangling with C++ when using templates

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-03-18T08:45:55Z
Last change time
2024-12-13T19:07:51Z
Assigned to
No Owner
Creator
Andrej Mitrovic
Moved to GitHub: dmd#17948 →

Comments

Comment #0 by andrej.mitrovich — 2020-03-18T08:45:55Z
cpp.cpp: ----- template<typename K, typename V> void cpp_test (const K&, const V&) { } #define INSTANTIATE(K, V) template void cpp_test<K, V>(const K&, const V&); INSTANTIATE(int, int) ----- d.d: ----- extern(C++) void cpp_test (K, V)(ref const K key, ref const V value); void main () { int i; cpp_test(i, i); } ----- $ g++ -c cpp.cpp -ocpp.o $ dmd -c d.d -ofd.o $ nm cpp.o | grep cpp_test 0000000000000000 W _Z8cpp_testIiiEvRKT_RKT0_ $ nm d.o | grep cpp_test U _Z8cpp_testIiiEvRT_RT0_ It seems that 'const' is missing. It seems similar to https://issues.dlang.org/show_bug.cgi?id=20336, only that here templates are involved.
Comment #1 by robert.schadek — 2024-12-13T19:07:51Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17948 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB