Previously if you had something like this:
template<typename T>
struct Foo {
template<typename U>
Foo(U);
};
Foo F(3.7);
this would mangle as ??$?0N@?$Foo@H@@QEAA@N@Z
and this would be demangled as:
undname: __cdecl Foo<int>::Foo<int><double>(double)
llvm-undname: __cdecl Foo<int>::Foo<int>(double)
Note the lack of the constructor template parameter in our
demangling.
This patch makes it so we print the constructor argument list.
llvm-svn: 340356
OS << "~";
LLVM_FALLTHROUGH;
case OperatorTy::Ctor:
+ // Output the class name with template arguments a second time.
outputNameComponent(OS, *Previous);
+
+ // Structors don't have a name, so outputting the name here actually is a
+ // no-op. But for template constructors, it needs to output the template
+ // argument list. e.g.
+ //
+ // template<typename T>
+ // struct Foo {
+ // template<typename U>
+ // Foo(U);
+ // };
+ // should demangle as -- for example -- Foo<int><double>(double);
+ outputNameComponent(OS, *TheName);
break;
case OperatorTy::Conversion:
OS << "operator";
??$f@US@@$1?g@1@QEAAXXZ@@YAXXZ
; CHECK: void __cdecl f<struct S, &void __cdecl S::g(void)>(void)
+
+??$?0N@?$Foo@H@@QEAA@N@Z
+; CHECK: __cdecl Foo<int>::Foo<int><double>(double)
\ No newline at end of file