[PATCH] D97955: [clang-tidy] Refactor loop-convert to bring most of the checking into matchers

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 10 13:48:51 PST 2021


njames93 marked 3 inline comments as done.
njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp:859
   const auto *LoopVar = Nodes.getNodeAs<VarDecl>(InitVarName);
-  const auto *EndVar = Nodes.getNodeAs<VarDecl>(EndVarName);
-
-  // If the loop calls end()/size() after each iteration, lower our confidence
-  // level.
-  if (FixerKind != LFK_Array && !EndVar)
-    ConfidenceLevel.lowerTo(Confidence::CL_Reasonable);
+  const VarDecl *EndVar = Nodes.getNodeAs<VarDecl>(EndVarName);
 
----------------
steveire wrote:
> Why change `auto` to `VarDecl` (repeated) here?
Changed it when I removed the initializer, forget to undo it when I added the initializer back.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97955



More information about the cfe-commits mailing list