martong added a comment. Thanks for the test Shafik, that is pretty self explanatory!
================ Comment at: clang/lib/AST/ASTImporter.cpp:8161 if (auto *ToRecord = dyn_cast<RecordDecl>(ToDC)) { auto *FromRecord = cast<RecordDecl>(FromDC); if (ToRecord->isCompleteDefinition()) { ---------------- What if we did this a bit differently? We could simply complete the From type if it is not completed, before getting into `ImportDefinition`. ``` if (ToRecord->isCompleteDefinition()) return ToDC; auto *FromRecord = cast<RecordDecl>(FromDC); if (FromRecord->hasExternalLexicalStorage() && !FromRecord->isCompleteDefinition()) FromRecord->getASTContext().getExternalSource()->CompleteType( FromRecord); ``` This way we could get rid of the redundant calls of `ImportDefinition`. As we have now a call for the case when we don't have external storage and for the case when we have. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78000/new/ https://reviews.llvm.org/D78000 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits