[PATCH] D140760: [clang-tidy] Support begin/end free functions in modernize-loop-convert

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 26 00:33:19 PST 2023


carlosgalvezp added a comment.

LGTM, minor comments. I'm not familiar with the implementation so I'm not very confident reviewing it, would be good to get some more expert eyes on it. Tests look solid!



================
Comment at: clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp:318
+// The returned Expr* is nullptr if any of the assumptions are not met.
+static const std::tuple<const Expr *, StringRef, bool>
+getContainerExpr(const Expr *Call) {
----------------
Remove `const`, it's unused.


================
Comment at: clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp:324
+    const auto *Member = dyn_cast<MemberExpr>(TheCall->getCallee());
+    if (!Member) {
+      return std::make_tuple(TheCall->getArg(0),
----------------
`if (const auto *Member = ...)`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140760



More information about the cfe-commits mailing list