[clang][ASTImporter] Fix a possible assertion failure `NeedsInjectedClassNameType(Decl)'.
The assertion can happen if ASTImporter imports a CXXRecordDecl in a template and then imports another redeclaration of this declaration, while the first import is in progress. The process of first import did not set the "described template" yet and the second import finds the first declaration at setting the injected types. Setting the injected type requires in the assertion that the described template is set. The exact assertion was: clang/lib/AST/ASTContext.cpp:4411: clang::QualType clang::ASTContext::getInjectedClassNameType(clang::CXXRecordDecl*, clang::QualType) const: Assertion `NeedsInjectedClassNameType(Decl)' failed. Reviewed By: shafik Differential Revision: https://reviews.llvm.org/D94067
Loading
Please sign in to comment