[clang-tools-extra] [clang-tidy] Fix false positive from `readability-redundant-typename` on partially specialized variables (PR #175473)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 13 08:11:30 PST 2026


================
@@ -25,22 +25,25 @@ void RedundantTypenameCheck::registerMatchers(MatchFinder *Finder) {
   if (!getLangOpts().CPlusPlus20)
     return;
 
-  const auto InImplicitTypenameContext = anyOf(
-      hasParent(decl(anyOf(
-          typedefNameDecl(), templateTypeParmDecl(), nonTypeTemplateParmDecl(),
-          friendDecl(), fieldDecl(),
-          varDecl(hasDeclContext(anyOf(namespaceDecl(), translationUnitDecl())),
-                  unless(parmVarDecl())),
----------------
localspook wrote:

If you add the function to handle `TemplateArgumentLoc` --- do all tests still pass?

https://github.com/llvm/llvm-project/pull/175473


More information about the cfe-commits mailing list