Bug 21310 – Itanium C++ mangler handling templated multiple pointer arguments with different type qualifiers incorrectly

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-10-14T23:44:00Z
Last change time
2024-12-13T19:12:06Z
Assigned to
No Owner
Creator
jamie
Moved to GitHub: dmd#19803 →

Comments

Comment #0 by jamie.border — 2020-10-14T23:44:00Z
Incorrect mangling for templated function with multiple pointer arguments with different type qualifiers. ---- extern(C++) void func(T)(const(T*) a, T* b); void main() { int i = 0; int* pi = &i; func(&i, pi); } ---- This is mangled to _Z4funcIiEvPKT_S1_ with the dmd Itanium C++ mangler implementation, whereas g++ gets _Z4funcIiEvPKT_PS0_ Issue seems to be in checking for substitution of args 2 onwards, where it finds a match between const(T*) and T*. Not an issue for non-templated functions.
Comment #1 by robert.schadek — 2024-12-13T19:12:06Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19803 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB