diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp b/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp index 1044df0032d8..c9ebf7b6f8ce 100644 --- a/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp @@ -18,7 +18,7 @@ namespace readability { void NonConstParameterCheck::registerMatchers(MatchFinder *Finder) { // Add parameters to Parameters. - Finder->addMatcher(parmVarDecl(unless(isInstantiated())).bind("Parm"), this); + Finder->addMatcher(parmVarDecl().bind("Parm"), this); // C++ constructor. Finder->addMatcher(cxxConstructorDecl().bind("Ctor"), this); @@ -28,13 +28,11 @@ void NonConstParameterCheck::registerMatchers(MatchFinder *Finder) { Finder->addMatcher(declRefExpr().bind("Ref"), this); // Analyse parameter usage in function. - Finder->addMatcher( - traverse(TK_AsIs, - stmt(anyOf(unaryOperator(hasAnyOperatorName("++", "--")), - binaryOperator(), callExpr(), returnStmt(), - cxxConstructExpr())) - .bind("Mark")), - this); + Finder->addMatcher(stmt(anyOf(unaryOperator(hasAnyOperatorName("++", "--")), + binaryOperator(), callExpr(), returnStmt(), + cxxConstructExpr())) + .bind("Mark"), + this); Finder->addMatcher(varDecl(hasInitializer(anything())).bind("Mark"), this); } |