[PATCH] D125171: Add a new clang-format option AlwaysBreakBeforeFunctionParameters
jonathan molinatto via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 11 07:25:17 PDT 2023
jrmolin marked 2 inline comments as done.
jrmolin added inline comments.
================
Comment at: clang/docs/ClangFormatStyleOptions.rst:1380
+ Example uses
+ ``AlwaysBreakAfterReturnType`` set to ``All``.
+
----------------
MyDeveloperDay wrote:
> This isn't relevant is it? `AlwaysBreakAfterReturnType`
No, it's not relevant, but I saw it in other examples, and I like the way it looks. I can change the example to be more minimal.
================
Comment at: clang/lib/Format/TokenAnnotator.cpp:4789
+ if (Left.is(tok::l_paren) && Style.AlwaysBreakBeforeFunctionParameters &&
+ !Right.is(tok::r_paren) && Left.Previous &&
+ Left.Previous->is(TT_FunctionDeclarationName)) {
----------------
MyDeveloperDay wrote:
> can you test the `()` case in your tests please with `AlwaysBreakBeforeFunctionParameters` set to true
updated the tests.
================
Comment at: clang/unittests/Format/FormatTest.cpp:25410-25415
+ verifyFormat("int function1(\n"
+ " int param1,\n"
+ " int param2,\n"
+ " int param3);\n"
+ "int function2();\n",
+ Code, Style);
----------------
MyDeveloperDay wrote:
>
Oh, I see. Sure!
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