[PATCH] D94131: [clang-tidy] Use new mapAnyOf matcher

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 6 03:54:33 PST 2021


njames93 added a comment.

Theres a few compile errors here in the pre merge. Is this patch based against trunk or some local branch?



================
Comment at: clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp:313
                // may be instantiated to use std::move() on built-in types.
-               binaryOperator(hasOperatorName("="), hasLHS(DeclRefMatcher)),
-               cxxOperatorCallExpr(hasOverloadedOperatorName("="),
-                                   hasArgument(0, DeclRefMatcher)),
+               binaryOperation(hasOperatorName("="), hasLHS(DeclRefMatcher)),
                // Declaration. We treat this as a type of reinitialization too,
----------------
This doesn't compile and it appears unrelated. Same beloe


================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/AvoidGotoCheck.cpp:32
   // out of a nested loop.
-  auto Loop = stmt(anyOf(forStmt(), cxxForRangeStmt(), whileStmt(), doStmt()));
-  auto NestedLoop =
-      stmt(anyOf(forStmt(hasAncestor(Loop)), cxxForRangeStmt(hasAncestor(Loop)),
-                 whileStmt(hasAncestor(Loop)), doStmt(hasAncestor(Loop))));
+  auto Loop = mapAnyOf(forStmt, cxxForRangeStmt, whileStmt, doStmt);
+  auto NestedLoop = Loop.with(hasAncestor(Loop.with(anything())));
----------------
Any reason for clang not finding this? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94131/new/

https://reviews.llvm.org/D94131



More information about the cfe-commits mailing list