[PATCH] D125171: Add a new clang-format option AlwaysBreakBeforeFunctionParameters

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 28 12:17:46 PDT 2023


HazardyKnusperkeks added a comment.

Looks good to me, not giving my formal approval since the ongoing discussion about the style guide.



================
Comment at: clang/include/clang/Format/Format.h:823
+  /// \endcode
+  /// \version 16.0
+  bool AlwaysBreakBeforeFunctionParameters;
----------------
Since when do we add the `.0`?


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:4742-4748
+  if (Left.is(tok::l_paren) && Style.AlwaysBreakBeforeFunctionParameters &&
+      !Right.is(tok::r_paren) && Left.Previous) {
+      const FormatToken &TwoPrevious = *Left.Previous;
+      if (TwoPrevious.is(TT_FunctionDeclarationName)) {
+          return true;
+      }
+  }
----------------
jrmolin wrote:
> HazardyKnusperkeks wrote:
> > That I meant with merge.
> Ah, understood. I generally don't collapse `if`s, so I didn't know how much you wanted. It seems like ... all of it.
I think now you need to format it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125171



More information about the cfe-commits mailing list