[PATCH] D156259: [clang-format] Fix a bug that erroneously placed function arguments on a new line despite all arguments being able to fit on the same line.

Jon Phillips via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 1 04:12:00 PDT 2023


jp4a50 added inline comments.


================
Comment at: clang/lib/Format/ContinuationIndenter.cpp:657-666
+  bool DisallowLineBreaksOnThisLine = [&Style = this->Style, &Current] {
+    // Deal with lambda arguments in C++. The aim here is to ensure that we
+    // don't over-indent lambda function bodies when lamdbas are passed as
+    // arguments to function calls. We do this by ensuring that either all
+    // arguments (including any lambdas) go on the same line as the function
+    // call, or we break before the first argument.
+    if (Style.Language != FormatStyle::LK_Cpp &&
----------------
HazardyKnusperkeks wrote:
> I'd go for this.
> But that's not necessary.
Ah, yes, I see what you mean, now! Easy enough change to make so I'll do it since there's a typo to fix as well anyway.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156259



More information about the cfe-commits mailing list