[PATCH] D109557: Adds a BlockIndent option to AlignAfterOpenBracket

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 12 17:55:23 PST 2021


owenpan added inline comments.


================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:951
 
+  if (PreviousNonComment && PreviousNonComment->is(tok::l_paren)) {
+    State.Stack.back().BreakBeforeClosingParen =
----------------
HazardyKnusperkeks wrote:
> Remove the braces
I think the braces should not be removed here. The [[ https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements | LLVM Coding Standards ]] says "braces should be used when a single-statement body is complex enough" which is rather subjective, but line wrapping is an objective metric and perhaps the only one we can apply.





Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109557/new/

https://reviews.llvm.org/D109557



More information about the cfe-commits mailing list