[PATCH] Use 'auto const&' for iterators whose deref operator returns a const var

Tareq A. Siraj tareq.a.siraj at intel.com
Thu Apr 11 07:16:38 PDT 2013



================
Comment at: cpp11-migrate/LoopConvert/LoopActions.cpp:789
@@ +788,3 @@
+      if (IteratorPointsToConst)
+        AutoRefType = Context->getConstType(AutoRefType);
+
----------------
Manuel Klimek wrote:
> This looks like a no-op. else { intended?
I think you're right. Will give it a try.

================
Comment at: cpp11-migrate/LoopConvert/LoopActions.cpp:1010
@@ +1009,3 @@
+          Nodes.getNodeAs<QualType>(DerefByRefResultName);
+      if (IteratorType) {
+        const ReferenceType *IteratorReferenceType =
----------------
Manuel Klimek wrote:
> Style hint: it's common llvm style to use
> if (const QualType* IteratorType = ...) {
> }
> -> makes the scope of IteratorType smaller.
Will do. Thanks.


http://llvm-reviews.chandlerc.com/D641



More information about the cfe-commits mailing list