================ @@ -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()); + continue; } + + if (!llvm::isa<NamedDecl>(*DeclOrErr)) + continue; + + NamedDecl *importedNamedDecl = llvm::cast<NamedDecl>(*DeclOrErr); + + SetExternalVisibleDeclsForName(ChildDeclContext, + importedNamedDecl->getDeclName(), + importedNamedDecl); + + if (!llvm::isa<CXXRecordDecl>(importedNamedDecl)) + continue; + + auto *Record = + llvm::cast<CXXRecordDecl>(importedNamedDecl); + + if (auto Err = Importer->ImportDefinition(Decl)) { + consumeError(std::move(Err)); ---------------- vgvassilev wrote:
Likewise. 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