[PATCH] D19586: Misleading Indentation check

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 08:11:33 PST 2017


alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:72
+        SM.getExpansionColumnNumber(NextLoc))
+      diag(NextLoc, "misleading indentation: statement is indented too deeply");
+  }
----------------
Will it be useful to add a note pointing to the control statement and saying "did you mean this line to be inside this if/while/for/..."?


================
Comment at: clang-tidy/readability/MisleadingIndentationCheck.cpp:79
+  Finder->addMatcher(
+      compoundStmt(anyOf(has(ifStmt()), has(forStmt()), has(whileStmt())))
+          .bind("compound"),
----------------
`has(anyOf(ifStmt(), forStmt(), whileStmt()))` would read better.


https://reviews.llvm.org/D19586





More information about the cfe-commits mailing list