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: unassignedclangb...@nondot.org
          Reporter: joac...@joameyer.de
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
                    neeil...@live.com, richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to