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

Edwin Vane edwin.vane at intel.com
Thu May 9 08:39:27 PDT 2013



================
Comment at: test/cpp11-migrate/LoopConvert/iterator.cpp:138
@@ +137,3 @@
+void const_f() {
+  // Tests to verify that the const qualification of the iterator.
+  S s;
----------------
I wouldn't focus on const-ness in these tests but rather if the init var type and the initializer are the same type. Please reflect this in the comments and the name of this function the tests are within. That is be sure to indicate these tests very auto is used properly in situations where the init var type and initializer type differ or are mostly the same except for const qualifiers.

Note, we do nothing about `volatile` currently. It should be handled identically to const but is beyond the scope of this patch.


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



More information about the cfe-commits mailing list