@@ -25,18 +25,18 @@ void RedundantTypenameCheck::registerMatchers(MatchFinder *Finder) {
2525 return ;
2626
2727 const auto InImplicitTypenameContext = anyOf (
28- hasParent (typedefNameDecl ()), hasParent (templateTypeParmDecl ()),
29- hasParent (nonTypeTemplateParmDecl ()), hasParent (cxxNamedCastExpr ()),
30- hasParent (cxxNewExpr ()), hasParent (friendDecl ()), hasParent (fieldDecl ()),
31- hasParent (
28+ hasParent (decl (anyOf (
29+ typedefNameDecl (), templateTypeParmDecl (), nonTypeTemplateParmDecl (),
30+ friendDecl (), fieldDecl (),
3231 varDecl (hasDeclContext (anyOf (namespaceDecl (), translationUnitDecl ())),
33- unless (parmVarDecl ()))),
34- hasParent (parmVarDecl (hasParent (expr (requiresExpr ())))),
35- hasParent (parmVarDecl (hasParent (typeLoc (hasParent (
36- namedDecl (anyOf (cxxMethodDecl (), hasParent (friendDecl ()),
37- functionDecl (has (nestedNameSpecifier ()))))))))),
38- // Match return types.
39- hasParent (functionDecl (unless (cxxConversionDecl ()))));
32+ unless (parmVarDecl ())),
33+ parmVarDecl (hasParent (expr (requiresExpr ()))),
34+ parmVarDecl (hasParent (typeLoc (hasParent (
35+ decl (anyOf (cxxMethodDecl (), hasParent (friendDecl ()),
36+ functionDecl (has (nestedNameSpecifier ())))))))),
37+ // Match return types.
38+ functionDecl (unless (cxxConversionDecl ()))))),
39+ hasParent (expr (anyOf (cxxNamedCastExpr (), cxxNewExpr ()))));
4040 Finder->addMatcher (typeLoc (InImplicitTypenameContext).bind (" typeloc" ), this );
4141}
4242
0 commit comments