================ @@ -159,29 +308,62 @@ void ExternalSource::completeVisibleDeclsMap( for (auto *DeclCtxt = ParentTUDeclCtxt; DeclCtxt != nullptr; DeclCtxt = DeclCtxt->getPreviousDecl()) { for (auto &IDeclContext : DeclCtxt->decls()) { - if (NamedDecl *Decl = llvm::dyn_cast<NamedDecl>(IDeclContext)) { - if (auto DeclOrErr = Importer->Import(Decl)) { - if (NamedDecl *importedNamedDecl = - llvm::dyn_cast<NamedDecl>(*DeclOrErr)) { - SetExternalVisibleDeclsForName(ChildDeclContext, - importedNamedDecl->getDeclName(), - importedNamedDecl); - } - - } else { - llvm::consumeError(DeclOrErr.takeError()); - } + if (!llvm::isa<NamedDecl>(IDeclContext)) + continue; + + NamedDecl *Decl = llvm::cast<NamedDecl>(IDeclContext); + + auto DeclOrErr = Importer->Import(Decl); + if (!DeclOrErr) { + llvm::consumeError(DeclOrErr.takeError()); ---------------- vgvassilev wrote:
Maybe add a comment here why error is fine. https://github.com/llvm/llvm-project/pull/67349 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits