[PATCH] D12076: Add loop-convert check to clang-tidy.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 17 03:43:32 PDT 2015


alexfh added a comment.

Some initial comments. I'll need a bit more time to review this thoroughly.


================
Comment at: test/clang-tidy/modernize-loop-convert.cpp:149
@@ +148,3 @@
+    arr[i] = 0;
+  // CHECK-MESSAGES-NOT: :[[@LINE-2]]:3: warning: use range-based for loop instead
+  // CHECK-FIXES: for (int i = 0; i < N; ++i)
----------------
You don't need CHECK-MESSAGES-NOT. The script runs FileCheck with -implicit-check-not='{{warning|error}}:', which would complain on any warning or error that you don't have a specific check pattern for.

I'd also trust clang-tidy to not make any changes in the code without a corresponding warning. Thus CHECK-FIXES that verify that the code isn't changed are superfluous.


http://reviews.llvm.org/D12076





More information about the cfe-commits mailing list