When looking up and adding substitutions to the substitution table, make sure to always use the canonical declaration. With tihs change, FileCheck compiles and links but crashes during startup.

llvm-svn: 86339
This commit is contained in:
Anders Carlsson 2009-11-07 04:26:04 +00:00
parent 08d5669b01
commit ce21431fc4
2 changed files with 11 additions and 0 deletions

View File

@ -65,6 +65,8 @@ namespace {
bool mangleStandardSubstitution(const NamedDecl *ND);
void addSubstitution(const NamedDecl *ND) {
ND = cast<NamedDecl>(ND->getCanonicalDecl());
addSubstitution(reinterpret_cast<uintptr_t>(ND));
}
void addSubstitution(QualType T);
@ -1174,6 +1176,7 @@ bool CXXNameMangler::mangleSubstitution(const NamedDecl *ND) {
if (mangleStandardSubstitution(ND))
return true;
ND = cast<NamedDecl>(ND->getCanonicalDecl());
return mangleSubstitution(reinterpret_cast<uintptr_t>(ND));
}

View File

@ -59,3 +59,11 @@ template void ft3<int>(S1<int>, S1<char>);
// CHECK: @_Z1fPKcS0_
void f(const char*, const char*) {}
namespace NS {
class C;
}
namespace NS {
// CHECK: @_ZN2NS1fERNS_1CE
void f(C&) { }
}