================ @@ -9955,6 +9955,45 @@ void ASTReader::finishPendingActions() { } PendingDefinitions.clear(); + for (auto [D, Previous] : PendingWarningForDuplicatedDefsInModuleUnits) { + auto hasDefinitionImpl = [this](Decl *D, auto hasDefinitionImpl) { + if (auto *VD = dyn_cast<VarDecl>(D)) + return VD->isThisDeclarationADefinition() || + VD->isThisDeclarationADemotedDefinition(); + + if (auto *TD = dyn_cast<TagDecl>(D)) + return TD->isThisDeclarationADefinition() || + TD->isThisDeclarationADemotedDefinition(); + + if (auto *FD = dyn_cast<FunctionDecl>(D)) + return FD->isThisDeclarationADefinition() || PendingBodies.count(FD); + + if (auto *RTD = dyn_cast<RedeclarableTemplateDecl>(D)) + return hasDefinitionImpl(RTD->getTemplatedDecl(), hasDefinitionImpl); + + // Conservatively return false here. + return false; + }; + + auto hasDefinition = [this, &hasDefinitionImpl](Decl *D) { ---------------- ChuanqiXu9 wrote:
Thanks and this looks to be fixed by someoneelse. Thanks again! https://github.com/llvm/llvm-project/pull/105799 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits