Skip to content

Commit b7a23d9

Browse files
committed
fix false negative with variable templates
1 parent 3e362cd commit b7a23d9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang-tools-extra/clang-tidy/readability/RedundantTypenameCheck.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ void RedundantTypenameCheck::registerMatchers(MatchFinder *Finder) {
3232
hasParent(typedefNameDecl()), hasParent(templateTypeParmDecl()),
3333
hasParent(nonTypeTemplateParmDecl()), hasParent(cxxNamedCastExpr()),
3434
hasParent(cxxNewExpr()), hasParent(friendDecl()), hasParent(fieldDecl()),
35+
hasParent(varDecl(unless(hasDeclContext(functionDecl())))),
3536
hasParent(parmVarDecl(hasParent(expr(requiresExpr())))),
3637
hasParent(parmVarDecl(hasParent(typeLoc(hasParent(
3738
namedDecl(anyOf(cxxMethodDecl(), hasParent(friendDecl()),

0 commit comments

Comments
 (0)