[PATCH] D19586: Misleading Indentation check

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 14 02:15:41 PST 2017


xazax.hun added inline comments.


================
Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:79
+  Finder->addMatcher(
+      compoundStmt(anyOf(has(ifStmt()), has(forStmt()), has(whileStmt())))
+          .bind("compound"),
----------------
alexfh wrote:
> 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.
That did the trick, thanks :)


Repository:
  rL LLVM

https://reviews.llvm.org/D19586





More information about the cfe-commits mailing list