[PATCH] D73843: [clang-tidy] Fix false positive for cppcoreguidelines-init-variables

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 1 15:26:17 PST 2020


njames93 marked an inline comment as done.
njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp:37
+              optionally(hasParent(declStmt(hasParent(
+                  cxxForRangeStmt(hasLoopVariable(varDecl().bind(BadDecl))))))),
+              unless(equalsBoundNode(BadDecl)))
----------------
No point checking if its a template definition or not. According to the standard it's not possible to have a for range statement where the loop variable isn't initialized.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73843





More information about the cfe-commits mailing list