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

Chris Cotter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 7 18:31:44 PDT 2023


ccotter marked 10 inline comments as done.
ccotter added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize/loop-convert-basic.cpp:477
+
+  for (S::const_iterator It = cbegin(Ss), E = cend(Ss); It != E; ++It) {
+    printf("s4 has value %d\n", (*It).X);
----------------
PiotrZSL wrote:
> what if begin,end is missing, and there is only cbegin, cend then it will fail with:
> "error: invalid range expression of type 'const A'; no viable 'begin' function available|
> 
This looks to be an already existing bug in the check - mind if I fix that in a separate phab?


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