[llvm-bugs] [Bug 50430] New: Mangling of substitutions for nested depending types differs from GCC and llvm-cxxfilt

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 21 02:13:21 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50430

            Bug ID: 50430
           Summary: Mangling of substitutions for nested depending types
                    differs from GCC and llvm-cxxfilt
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: joachim at joameyer.de
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

When trying to use GCC as host compiler for SYCL-BLAS and Clang as device /
library compiler, I could not link successfully, as there was a mangling
discrepancy.

I tried to reduce the example and ended up with:
https://godbolt.org/z/967PWWdv8
The difference is in the sequence id of the 3rd parameter, which should reuse
the 2nd parameter's template type.

When demangling using llvm-cxxfilt, Clang's mangling results in the 3rd
parameter's type to match the 1st parameter type's type instead of the second:

$ llvm-cxxfilt _Z1fI12TemplateTypeI8UsedTypeEiENT_6InnerT7NestedTERS3_T0_S6_
TemplateType<UsedType>::InnerT::NestedT f<TemplateType<UsedType>,
int>(TemplateType<UsedType>&, int, TemplateType<UsedType>&)

GCC references the correct one, as of llvm-cxxfilt:
$ llvm-cxxfilt _Z1fI12TemplateTypeI8UsedTypeEiENT_6InnerT7NestedTERS3_T0_S7_
TemplateType<UsedType>::InnerT::NestedT f<TemplateType<UsedType>,
int>(TemplateType<UsedType>&, int, int)

The offending type that is counted differently, is the nested depending types
-> it works if the return type would be `TemplateType<UsedType>::InnerT`
instead of `TemplateType<UsedType>::InnerT::NestedT` (see f2 in godbolt
example).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210521/4174ca8a/attachment-0001.html>


More information about the llvm-bugs mailing list