================ @@ -181,42 +160,105 @@ void ConfusableIdentifierCheck::check( if (!ND) return; - IdentifierInfo *NDII = ND->getIdentifier(); + addDeclToCheck(ND, cast<Decl>(ND->getDeclContext() + ->getNonTransparentContext())); + + // Associate template parameters with this declaration of this template. + if (const auto *TD = dyn_cast<TemplateDecl>(ND)) { + for (const NamedDecl *Param : *TD->getTemplateParameters()) + addDeclToCheck(Param, TD->getTemplatedDecl()); + } + + // Associate function parameters with this declaration of this function. + if (const auto *FD = dyn_cast<FunctionDecl>(ND)) { + for (const NamedDecl *Param : FD->parameters()) + addDeclToCheck(Param, ND); + } +} + +void ConfusableIdentifierCheck::addDeclToCheck(const NamedDecl *ND, ---------------- zygoloid wrote:
Done. https://github.com/llvm/llvm-project/pull/130369 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits