Re: [PATCH] D12933: Add a test to modernize-loop-convert.

2015-09-17 Thread Angel Garcia via cfe-commits
angelgarcia updated this revision to Diff 34993.
angelgarcia added a comment.

Done.


http://reviews.llvm.org/D12933

Files:
  test/clang-tidy/modernize-loop-convert-extra.cpp

Index: test/clang-tidy/modernize-loop-convert-extra.cpp
===
--- test/clang-tidy/modernize-loop-convert-extra.cpp
+++ test/clang-tidy/modernize-loop-convert-extra.cpp
@@ -702,21 +702,15 @@
 printf("Value: %d\n", CONT arr[i]);
   }
 
-  // FIXME: Right now, clang-tidy does not allow to make insertions in several
-  // arguments of the same macro call. The following code:
-  // \code
-  //   for (int i = 0; i < N; ++i) {
-  //TWO_PARAM(arr[i], arr[i]);
-  //THREE_PARAM(arr[i], arr[i], arr[i]);
-  //   }
-  // \endcode
-  // Should be converted to this:
-  // \code
-  //   for (auto & elem : arr) {
-  //TWO_PARAM(elem, elem);
-  //THREE_PARAM(elem, elem, elem);
-  //   }
-  // \endcode
+  // Multiple macro arguments.
+  for (int i = 0; i < N; ++i) {
+TWO_PARAM(arr[i], arr[i]);
+THREE_PARAM(arr[i], arr[i], arr[i]);
+  }
+  // CHECK-MESSAGES: :[[@LINE-4]]:3: warning: use range-based for loop instead
+  // CHECK-FIXES: for (auto & elem : arr)
+  // CHECK-FIXES-NEXT: TWO_PARAM(elem, elem);
+  // CHECK-FIXES-NEXT: THREE_PARAM(elem, elem, elem);
 }
 
 } // namespace Macros


Index: test/clang-tidy/modernize-loop-convert-extra.cpp
===
--- test/clang-tidy/modernize-loop-convert-extra.cpp
+++ test/clang-tidy/modernize-loop-convert-extra.cpp
@@ -702,21 +702,15 @@
 printf("Value: %d\n", CONT arr[i]);
   }
 
-  // FIXME: Right now, clang-tidy does not allow to make insertions in several
-  // arguments of the same macro call. The following code:
-  // \code
-  //   for (int i = 0; i < N; ++i) {
-  //TWO_PARAM(arr[i], arr[i]);
-  //THREE_PARAM(arr[i], arr[i], arr[i]);
-  //   }
-  // \endcode
-  // Should be converted to this:
-  // \code
-  //   for (auto & elem : arr) {
-  //TWO_PARAM(elem, elem);
-  //THREE_PARAM(elem, elem, elem);
-  //   }
-  // \endcode
+  // Multiple macro arguments.
+  for (int i = 0; i < N; ++i) {
+TWO_PARAM(arr[i], arr[i]);
+THREE_PARAM(arr[i], arr[i], arr[i]);
+  }
+  // CHECK-MESSAGES: :[[@LINE-4]]:3: warning: use range-based for loop instead
+  // CHECK-FIXES: for (auto & elem : arr)
+  // CHECK-FIXES-NEXT: TWO_PARAM(elem, elem);
+  // CHECK-FIXES-NEXT: THREE_PARAM(elem, elem, elem);
 }
 
 } // namespace Macros
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D12933: Add a test to modernize-loop-convert.

2015-09-17 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG with a comment.



Comment at: test/clang-tidy/modernize-loop-convert-extra.cpp:705
@@ -704,16 +704,3 @@
 
-  // FIXME: Right now, clang-tidy does not allow to make insertions in several
-  // arguments of the same macro call. The following code:
-  // \code
-  //   for (int i = 0; i < N; ++i) {
-  //TWO_PARAM(arr[i], arr[i]);
-  //THREE_PARAM(arr[i], arr[i], arr[i]);
-  //   }
-  // \endcode
-  // Should be converted to this:
-  // \code
-  //   for (auto & elem : arr) {
-  //TWO_PARAM(elem, elem);
-  //THREE_PARAM(elem, elem, elem);
-  //   }
-  // \endcode
+  // Multiple arguments.
+  for (int i = 0; i < N; ++i) {

"Multiple macro arguments." would be clearer.


http://reviews.llvm.org/D12933



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