[PATCH] D15251: [Clang] Use range loops and autos in lib/Serialization/ASTReader.cpp

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 7 12:29:25 PST 2015


aaron.ballman added inline comments.

================
Comment at: lib/Serialization/ASTReader.cpp:5074
@@ -5087,3 +5073,3 @@
     bool operator()(ModuleFile &M) {
-      HeaderFileInfoLookupTable *Table
+      auto *Table
         = static_cast<HeaderFileInfoLookupTable *>(M.HeaderFileInfoTable);
----------------
Eugene.Zelenko wrote:
> I don't think it's good idea to make coding practices depending on formatting. 
> I don't think it's good idea to make coding practices depending on formatting.

I disagree. The use of auto is only when it adds to readability of the code. We've distilled this down to cases where the type is obvious due to already being stated in the initialization of the variable. If that initialization means I have to look somewhere else to see the actual type, then the benefit of auto is reduced.


http://reviews.llvm.org/D15251





More information about the cfe-commits mailing list