[PATCH] D51949: [clang-tidy] new check 'readability-isolate-declaration'

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 7 08:08:21 PDT 2018


kbobyrev added inline comments.


================
Comment at: clang-tidy/readability/IsolateDeclarationCheck.cpp:24
+AST_MATCHER(DeclStmt, onlyDeclaresVariables) {
+  return std::all_of(Node.decl_begin(), Node.decl_end(),
+                     [](Decl *D) { return isa<VarDecl>(D); });
----------------
It would be shorter to use `llvm::all_of(Node.decls(), ...);`


================
Comment at: clang-tidy/readability/IsolateDeclarationCheck.cpp:30
+              InnerMatcher) {
+  const Stmt *InitStmt = Node.getInit();
+  return InitStmt ? InnerMatcher.matches(*InitStmt, Finder, Builder) : false;
----------------
Maybe inline this variable?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51949





More information about the cfe-commits mailing list