LuMa created this revision. Current description of flag AllowAllParametersOfDeclarationOnNextLine in 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 example is not reproducible and makes no sense. I have added valid example and have stressed that flag applies only if declaration doesn't fit in a single line.
https://reviews.llvm.org/D37513 Files: docs/ClangFormatStyleOptions.rst Index: docs/ClangFormatStyleOptions.rst =================================================================== --- docs/ClangFormatStyleOptions.rst +++ docs/ClangFormatStyleOptions.rst @@ -271,15 +271,29 @@ int b = 2; // comment b int b = 2; // comment about b **AllowAllParametersOfDeclarationOnNextLine** (``bool``) - Allow putting all parameters of a function declaration onto - the next line even if ``BinPackParameters`` is ``false``. + If the function declaration doesn't fit on a line, + allow putting all parameters onto the next line + even if ``BinPackParameters`` is ``false``. + + This applies to declaration, whose parameters fit on a single line. .. code-block:: c++ - true: false: - myFunction(foo, vs. myFunction(foo, bar, plop); - bar, - plop); + true: + int SomeFuncionWithVeryLooooooooongName( + int a, int b, int c, int d, int e, int f) { + return 0; + } + + false: + int SomeFuncionWithVeryLooooooooongName(int a, + int b, + int c, + int d, + int e, + int f) { + return 0; + } **AllowShortBlocksOnASingleLine** (``bool``) Allows contracting simple braced statements to a single line.
Index: docs/ClangFormatStyleOptions.rst =================================================================== --- docs/ClangFormatStyleOptions.rst +++ docs/ClangFormatStyleOptions.rst @@ -271,15 +271,29 @@ int b = 2; // comment b int b = 2; // comment about b **AllowAllParametersOfDeclarationOnNextLine** (``bool``) - Allow putting all parameters of a function declaration onto - the next line even if ``BinPackParameters`` is ``false``. + If the function declaration doesn't fit on a line, + allow putting all parameters onto the next line + even if ``BinPackParameters`` is ``false``. + + This applies to declaration, whose parameters fit on a single line. .. code-block:: c++ - true: false: - myFunction(foo, vs. myFunction(foo, bar, plop); - bar, - plop); + true: + int SomeFuncionWithVeryLooooooooongName( + int a, int b, int c, int d, int e, int f) { + return 0; + } + + false: + int SomeFuncionWithVeryLooooooooongName(int a, + int b, + int c, + int d, + int e, + int f) { + return 0; + } **AllowShortBlocksOnASingleLine** (``bool``) Allows contracting simple braced statements to a single line.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits