[PATCH] D19586: Misleading Indentation check

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 02:07:59 PST 2017


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

LG



================
Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:79
+  Finder->addMatcher(
+      compoundStmt(anyOf(has(ifStmt()), has(forStmt()), has(whileStmt())))
+          .bind("compound"),
----------------
xazax.hun wrote:
> alexfh wrote:
> > `has(anyOf(ifStmt(), forStmt(), whileStmt()))` would read better.
> I agree but unfortunately that does not compile. 
Yep, with matchers you never know what will compile ;)

Maybe `has(stmt(anyOf(ifStmt(), forStmt(), whileStmt())))`? If this also doesn't work, then it's fine as is.


https://reviews.llvm.org/D19586





More information about the cfe-commits mailing list