================ @@ -635,17 +635,20 @@ bool SymbolCollector::handleDeclOccurrence( return true; const Symbol *BasicSymbol = Symbols.find(ID); - if (isPreferredDeclaration(*OriginalDecl, Roles)) + bool SkipDocCheckInDef = false; + if (isPreferredDeclaration(*OriginalDecl, Roles)) { // If OriginalDecl is preferred, replace/create the existing canonical // declaration (e.g. a class forward declaration). There should be at most // one duplicate as we expect to see only one preferred declaration per // TU, because in practice they are definitions. BasicSymbol = addDeclaration(*OriginalDecl, std::move(ID), IsMainFileOnly); - else if (!BasicSymbol || DeclIsCanonical) + SkipDocCheckInDef = true; + } else if (!BasicSymbol || DeclIsCanonical) { BasicSymbol = addDeclaration(*ND, std::move(ID), IsMainFileOnly); ---------------- HighCommander4 wrote:
I think we want `SkipDocCheckInDef = true` in this branch as well. This is actually the more common case that will be hit, for first declarations which are also definitions (`DeclIsCanonical` is true). https://github.com/llvm/llvm-project/pull/67802 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits