[PATCH] D12797: Refactor LoopConvertCheck.

Angel Garcia via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 06:14:50 PDT 2015


angelgarcia marked 9 inline comments as done.

================
Comment at: clang-tidy/modernize/LoopConvertCheck.cpp:494-495
@@ -493,4 +502,2 @@
     } else {
-      if (Descriptor.DerefByConstRef)
-        AutoRefType = Context->getConstType(AutoRefType);
       AutoRefType = Context->getLValueReferenceType(AutoRefType);
----------------
klimek wrote:
> I assume the change in the tests is due to the bug here? :)
I'm not sure if it was a bug or just different priorities, but that's not reason. "DerefByValue" is a weird case and we don't have many tests for that. The change is due to:

// If the initializer and variable have both the same type just use auto
// otherwise we test for const qualification of the pointed-at type.

At line 726 (somewhere inside the iterator loops logic). I removed the conditional because we always want to check for const qualification.




http://reviews.llvm.org/D12797





More information about the cfe-commits mailing list