[PATCH] D16259: Add clang-tidy readability-redundant-control-flow check

Richard via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 28 19:27:04 PST 2016


LegalizeAdulthood marked 4 inline comments as done.

================
Comment at: clang-tidy/readability/RedundantControlFlowCheck.cpp:59
@@ +58,3 @@
+  CompoundStmt::const_reverse_body_iterator last = Block->body_rbegin();
+  if (const auto *Return = dyn_cast<ReturnStmt>(*last)) {
+    issueDiagnostic(Result, Block, Return->getSourceRange(),
----------------
aaron.ballman wrote:
> Elide braces.
This keeps coming up.  My fingers **really** want to type braces around bodies of control structures.

If omitting the braces is the "LLVM/clang style", then we should have a clang-tidy check that fixes this :-).


http://reviews.llvm.org/D16259





More information about the cfe-commits mailing list