[PATCH] D12734: Another patch for modernize-loop-convert.

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 04:01:20 PDT 2015


klimek added inline comments.

================
Comment at: clang-tidy/modernize/LoopConvertCheck.cpp:468-470
@@ +467,5 @@
+        // are VarDecl). If the index is captured by value, add '&' to capture
+        // by reference instead.
+        ReplaceText =
+            Usage.Kind == Usage::UK_CaptureByCopy ? "&" + VarName : VarName;
+      }
----------------
Isn't it the other way round?

================
Comment at: clang-tidy/modernize/LoopConvertUtils.h:200-205
@@ -199,1 +199,8 @@
 struct Usage {
+  enum UsageKind {
+    UK_Default,
+    UK_MemberThroughArrow,
+    UK_CaptureByCopy,
+    UK_CaptureByRef
+  };
+  // The expression that is going to be converted. Null in case of lambda
----------------
Please comment the enumerators. Do we need default? Is that always a member expression or sometimes also something else?


http://reviews.llvm.org/D12734





More information about the cfe-commits mailing list