Don't crash when trying to mangle function templates.

llvm-svn: 82872
This commit is contained in:
Anders Carlsson 2009-09-26 20:13:56 +00:00
parent 26e67afd1e
commit 49232b9f42
2 changed files with 20 additions and 2 deletions

View File

@ -335,7 +335,7 @@ void CXXNameMangler::mangleUnscopedTemplateName(const TemplateDecl *ND) {
if (mangleSubstitution(ND))
return;
mangleUnscopedName(ND);
mangleUnscopedName(ND->getTemplatedDecl());
addSubstitution(ND);
}
@ -532,7 +532,7 @@ void CXXNameMangler::mangleTemplatePrefix(const TemplateDecl *ND) {
// FIXME: <substitution> and <template-param>
manglePrefix(ND->getDeclContext());
mangleUnqualifiedName(ND);
mangleUnqualifiedName(ND->getTemplatedDecl());
}
void

View File

@ -155,3 +155,21 @@ template<typename T> struct S6 {
template<typename T> void ft5(typename S6<T>::B) { }
// CHECK: @_Z3ft5IiEvN2S6IT_E1BE
template void ft5<int>(int);
template<typename T> class A {};
namespace NS {
template<typename T> bool operator==(const A<T>&, const A<T>&) { return true; }
}
// FIXME: This should be _ZN2NSeqIcEEbRK1AIT_ES5_
// CHECK: @_ZN2NSeqIcEEbRK1AIT_ES4_
template bool NS::operator==(const ::A<char>&, const ::A<char>&);
namespace std {
template<typename T> bool operator==(const A<T>&, const A<T>&) { return true; }
}
// CHECK: @_ZSteqIcEbRK1AIT_ES4_
template bool std::operator==(const ::A<char>&, const ::A<char>&);