forked from OSchip/llvm-project
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:
parent
08d5669b01
commit
ce21431fc4
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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&) { }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue