klimek added inline comments.

================
Comment at: clang-tidy/modernize/LoopConvertCheck.cpp:371-373
@@ -370,1 +370,5 @@
 
+/// \brief Returns false when it can be guaranteed that no container element
+/// is going to be modified due to this expression.
+static bool canBeModified(ASTContext *Context, const Expr *E) {
+  auto Parents = Context->getParents(*E);
----------------
Reading just this function, it is unclear what the 'container' is.

================
Comment at: clang-tidy/modernize/LoopConvertCheck.cpp:392
@@ +391,3 @@
+  for (const Usage &U : Usages) {
+    if (U.Kind != Usage::UK_CaptureByCopy && U.Kind != Usage::UK_CaptureByRef 
&&
+        canBeModified(Context, U.Expression))
----------------
Can't CaptureBuRef be modified?

================
Comment at: test/clang-tidy/modernize-loop-convert-const.cpp:233
@@ +232,3 @@
+void takingReferences() {
+  // We do it twice to prevent the check from thinking that they are aliases.
+
----------------
But they are aliases. Shouldn't we then go into the const-ness of the aliases?


http://reviews.llvm.org/D14198



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to