forked from OSchip/llvm-project
[ASTImporter] Fix IsStructuralMatch specialization for EnumDecl to prevent re-importing an EnumDecl while trying to complete it
Summary: We may try and re-import an EnumDecl while trying to complete it in IsStructuralMatch(...) specialization for EnumDecl. This change mirrors a similar fix for the specialization for RecordDecl. Differential Revision: https://reviews.llvm.org/D59845 llvm-svn: 357100
This commit is contained in:
parent
f8666b0649
commit
e5094d6d3d
|
@ -1946,6 +1946,12 @@ bool ASTNodeImporter::IsStructuralMatch(VarDecl *FromVar, VarDecl *ToVar,
|
|||
}
|
||||
|
||||
bool ASTNodeImporter::IsStructuralMatch(EnumDecl *FromEnum, EnumDecl *ToEnum) {
|
||||
// Eliminate a potential failure point where we attempt to re-import
|
||||
// something we're trying to import while completin ToEnum
|
||||
if (Decl *ToOrigin = Importer.GetOriginalDecl(ToEnum))
|
||||
if (auto *ToOriginEnum = dyn_cast<EnumDecl>(ToOrigin))
|
||||
ToEnum = ToOriginEnum;
|
||||
|
||||
StructuralEquivalenceContext Ctx(
|
||||
Importer.getFromContext(), Importer.getToContext(),
|
||||
Importer.getNonEquivalentDecls(), getStructuralEquivalenceKind(Importer));
|
||||
|
|
Loading…
Reference in New Issue