forked from OSchip/llvm-project
MS ABI: Use the most recent decl to check the inheritance model
This was crashing compilation of DeclContext::buildLookupImpl<>. llvm-svn: 201013
This commit is contained in:
parent
f8b417c5ef
commit
e253b098d3
|
@ -1084,12 +1084,13 @@ void MicrosoftCXXNameMangler::mangleTemplateArg(const TemplateDecl *TD,
|
|||
case TemplateArgument::Declaration: {
|
||||
const NamedDecl *ND = cast<NamedDecl>(TA.getAsDecl());
|
||||
if (isa<FieldDecl>(ND) || isa<IndirectFieldDecl>(ND)) {
|
||||
mangleMemberDataPointer(cast<CXXRecordDecl>(ND->getDeclContext()),
|
||||
cast<ValueDecl>(ND));
|
||||
mangleMemberDataPointer(
|
||||
cast<CXXRecordDecl>(ND->getDeclContext())->getMostRecentDecl(),
|
||||
cast<ValueDecl>(ND));
|
||||
} else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(ND)) {
|
||||
const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD);
|
||||
if (MD && MD->isInstance())
|
||||
mangleMemberFunctionPointer(MD->getParent(), MD);
|
||||
mangleMemberFunctionPointer(MD->getParent()->getMostRecentDecl(), MD);
|
||||
else
|
||||
mangle(FD, "$1?");
|
||||
} else {
|
||||
|
|
|
@ -22,6 +22,10 @@ int ReadField(T &o) {
|
|||
return F ? o.*F : 0;
|
||||
}
|
||||
|
||||
// Redeclare some of the classes so that the implicit attribute goes on the most
|
||||
// recent redeclaration rather than the definition.
|
||||
struct V;
|
||||
|
||||
void ReadFields() {
|
||||
A a;
|
||||
I i;
|
||||
|
|
Loading…
Reference in New Issue