[PATCH] D17134: [clang-tidy] Fix an assert failure of ForStmt in `readability-braces-around-statements` check.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 11 10:28:39 PST 2016


alexfh added inline comments.

================
Comment at: test/clang-tidy/readability-braces-around-statements-assert-failure.cpp:13
@@ +12,3 @@
+  std::vector<int> e;
+  for (typename std::vector<T>::const_reverse_iterator iter = e.begin(),
+                                                       end2 = e.end();
----------------
hokein wrote:
> alexfh wrote:
> > Can you further reduce the test case so it still causes a crash, but doesn't generate so many compilation errors?
> > 
> > The problem with matching compilation errors in clang-tidy tests is that a change in Clang parser can break clang-tidy tests. The more errors you verify, the higher the chance of this kind of a breakage. If we need to verify clang errors, we should keep their number minimal.
> Indeed, this is the minimal test case.
> 
> Is there a way to modify the test script to ignore message of compilation errors?
Interesting. Does creduce fail to further reduce the test?

As for ignoring errors, it's rather rarely needed in tests. Usually, we need the reverse: to ensure tests compile without errors. If we want to ignore errors here, we can either run clang-tidy and FileCheck directly from the test or add a parameter to the script to modify the -implicit-check-not parameter of the FileCheck.


Repository:
  rL LLVM

http://reviews.llvm.org/D17134





More information about the cfe-commits mailing list