[Issue 21310] New: Itanium C++ mangler handling templated multiple pointer arguments with different type qualifiers incorrectly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 14 23:44:00 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=21310

          Issue ID: 21310
           Summary: Itanium C++ mangler handling templated multiple
                    pointer arguments with different type qualifiers
                    incorrectly
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: jamie.border at uq.net.au

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.

--


More information about the Digitalmars-d-bugs mailing list