The current description of AllowAllParametersOfDeclarationOnNextLine in
the Clang-Format Style Options guide suggests that it is possible to
format function declaration, which fits in a single line (what is not
supported in current clang-format version). Also the example was not
reproducible and mades no sense.
Patch by Lucja Mazur, thank you!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312721
91177308-0d34-0410-b5e6-
96231b3b80d8
int b = 2; // comment b int b = 2; // comment about b
**AllowAllParametersOfDeclarationOnNextLine** (``bool``)
- Allow putting all parameters of a function declaration onto
+ If the function declaration doesn't fit on a line,
+ allow putting all parameters of a function declaration onto
the next line even if ``BinPackParameters`` is ``false``.
.. code-block:: c++
- true: false:
- myFunction(foo, vs. myFunction(foo, bar, plop);
- bar,
- plop);
+ true:
+ void myFunction(
+ int a, int b, int c, int d, int e);
+
+ false:
+ void myFunction(int a,
+ int b,
+ int c,
+ int d,
+ int e);
**AllowShortBlocksOnASingleLine** (``bool``)
Allows contracting simple braced statements to a single line.
/// \endcode
bool AlignTrailingComments;
- /// \brief Allow putting all parameters of a function declaration onto
+ /// \brief If the function declaration doesn't fit on a line,
+ /// allow putting all parameters of a function declaration onto
/// the next line even if ``BinPackParameters`` is ``false``.
/// \code
- /// true: false:
- /// myFunction(foo, vs. myFunction(foo, bar, plop);
- /// bar,
- /// plop);
+ /// true:
+ /// void myFunction(
+ /// int a, int b, int c, int d, int e);
+ ///
+ /// false:
+ /// void myFunction(int a,
+ /// int b,
+ /// int c,
+ /// int d,
+ /// int e);
/// \endcode
bool AllowAllParametersOfDeclarationOnNextLine;