================
@@ -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())),
----------------
zwuis wrote:

> I tested `varDecl(forEach(typeLoc().bind("t")))` and 
> `varDecl(forEachDescendant(typeLoc().bind("t")))`. The latter binds template 
> arguments of variable template partial specializations, but the former only 
> binds the type of variables, which is different from `hasParent` in this 
> check. I'm investigating what's going on.

AST (view of astmatchers):
```
VarTemplatePartialSpecializationDecl
`-TemplateArgument
  `-TypeLoc
```

It seems that `hasParent` doesn't work expectedly.

https://github.com/llvm/llvm-project/pull/175473
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to