[PATCH] D148131: Avoid unnecessarily aggressive line-breaking when using "LambdaBodyIndentation: OuterScope" with argument bin-packing.

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 03:10:53 PDT 2023


owenpan accepted this revision.
owenpan added a comment.

LG with a couple of minor comments.



================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:334
+      // enabled.
+      !(Current.is(TT_LambdaLBrace) && Style.BraceWrapping.BeforeLambdaBody) &&
       CurrentState.NoLineBreakInOperand) {
----------------
To be consistent with line 1116 below.


================
Comment at: clang/unittests/Format/FormatTest.cpp:22789
+  // doesn't force an initial line break, even if lambdas span multiple lines.
+  // This should probably be considered a bug.
+  verifyFormat("void foo() {\n"
----------------
If so, we should put the test case below in a `#if 0`-`#endif` block with a `FIXME` comment?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148131



More information about the cfe-commits mailing list