a.sidorin added a comment. Thank you Kareem, It looks mostly good, but I'd like to have some functional tests in ASTMerge for this patch.
================ Comment at: lib/AST/ASTImporter.cpp:4299 + if (ImportDeclParts(D, DC, LexicalDC, Name, AlreadyImported, Loc)) + return NULL; + assert(DC && "Null DeclContext after importing decl parts"); ---------------- nullptr ================ Comment at: lib/AST/ASTImporter.cpp:4323 + for (UsingShadowDecl *I : D->shadows()) { + UsingShadowDecl *SD = cast<UsingShadowDecl>(Importer.Import(I)); + ToD->addShadowDecl(SD); ---------------- This will assert if import fails. We need to use `cast_or_null` and check for null returns. (If this is the result of my misleading code, sorry for this.) ================ Comment at: lib/AST/ASTImporter.cpp:4335 + if (ImportDeclParts(D, DC, LexicalDC, Name, AlreadyImported, Loc)) + return NULL; + assert(DC && "Null DeclContext after importing decl parts"); ---------------- nullptr ================ Comment at: lib/AST/ASTImporter.cpp:4342 + Importer.getToContext(), DC, Loc, + cast<UsingDecl>(Importer.Import(D->getUsingDecl())), + cast_or_null<NamedDecl>(Importer.Import(D->getTargetDecl()))); ---------------- This will assert if import fails. We need to use cast_or_null and check for null returns. https://reviews.llvm.org/D27181 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits