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