[PATCH] D63127: [clang-tidy] Fixed checker for abseil to work in C++17 mode

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 11 05:01:45 PDT 2019


gribozavr added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp:86
+                .bind("ByAnyChar"),
+            expr(hasDescendant(cxxConstructExpr(
+                     hasType(recordDecl(hasName("::absl::ByAnyChar"))),
----------------
hasDescendant will find any child, no matter how deeply nested. I think in this case we only want the expression itself to be equal to ByAnyChar call. Shouldn't this code use the elidable matcher you're adding in another file?


================
Comment at: clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp:121
+
   SourceRange Range = Literal->getSourceRange();
 
----------------
Unrelated edit?


================
Comment at: clang-tools-extra/clang-tidy/abseil/TimeSubtractionCheck.cpp:34
+  return selectFirst<const Expr>("e",
+                                 match(expr(hasAncestor(varDecl())).bind("e"),
+                                       *Node, *Result.Context)) != nullptr;
----------------
Ditto, hasAncestor can go too far up the tree.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63127





More information about the cfe-commits mailing list