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

            Bug ID: 42192
           Summary: Mangler incorrectly handles templated decltype in
                    parameter type
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

Given this code:

template <bool _Bp, class _If, class _Then> struct cond {
  using type = _If;
  _If memvar;
};

template<bool b>
void t2(decltype(cond<b, int, char>::memvar) param) { }

template void t2<true>(int);

gcc mangles this as _Z2t2ILb1EEvDtsr4condIXT_EifE6memvarE
clang mangles it as _Z2t2ILb1EEvDtsr4condIXT_EicEE6memvarE

demangler.com can demangle gcc's version but not clang's.

See gcc trunk vs clang trunk at https://godbolt.org/z/Rxn4XN

clang has been able to compile this code since at least as far back as version
3.8, but apparently has always mangled it wrong.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to