[PATCH] D100092: [clang-tidy] cppcoreguidelines-declare-loop-variable-in-the-initializer: a new check

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 29 07:07:25 PDT 2021


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/DeclareLoopVariableInTheInitializerCheck.cpp:37
+  bool VisitDeclRefExpr(DeclRefExpr *D) {
+    if (const VarDecl *To = dyn_cast<VarDecl>(D->getDecl())) {
+      if (To == MatchedDecl &&
----------------
`const auto*` could be used because type is spelled in same statement.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100092



More information about the cfe-commits mailing list