[PATCH] D12530: Fix several corner cases for loop-convert check.

Angel Garcia via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 1 07:51:49 PDT 2015


angelgarcia marked 2 inline comments as done.

================
Comment at: test/clang-tidy/modernize-loop-convert-basic.cpp:448
@@ +447,3 @@
+    ret = it;
+  }
+}
----------------
klimek wrote:
> This test seems to be missing the it.insert(0) case that was removed from the "unsupported"  comment, if I'm not missing something.
It was in the test 'modernize-loop-convert-negative.cpp'. I moved these ones there as well.

================
Comment at: test/clang-tidy/modernize-loop-convert-basic.cpp:540-541
@@ -518,4 +539,4 @@
   unsigned size() const;
-  unsigned begin() const;
-  unsigned end() const;
+  unsigned* begin() const;
+  unsigned* end() const;
 };
----------------
klimek wrote:
> Isn't it important that it's a pointer to an unsigned const, not that the iterator method is const?
The important thing is that the check now adds a "const" whenever it is safe to do it. I changed the return type to a pointer just to be more consistent with what an iterator is supposed to be. It isn't important at all in this case.


http://reviews.llvm.org/D12530





More information about the cfe-commits mailing list