From 8702c6da162b6db962c8155195d79f1e002bc481 Mon Sep 17 00:00:00 2001 From: Marek Kurdej Date: Fri, 28 May 2021 21:48:13 +0200 Subject: [PATCH] [clang-format] [docs] Regenerate style options documentation. Forgotten in commits fce8c10b, 9363aa90, 8d93d7ff. --- clang/docs/ClangFormatStyleOptions.rst | 89 ++++++++++++++++++++++++++++------ 1 file changed, 75 insertions(+), 14 deletions(-) diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst index 986963c..4598877 100644 --- a/clang/docs/ClangFormatStyleOptions.rst +++ b/clang/docs/ClangFormatStyleOptions.rst @@ -773,7 +773,7 @@ the configuration (without a prefix: ``Auto``). **AllowShortIfStatementsOnASingleLine** (``ShortIfStyle``) - If ``true``, ``if (a) return;`` can be put on a single line. + Dependent on the value, ``if (a) return;`` can be put on a single line. Possible values: @@ -783,28 +783,67 @@ the configuration (without a prefix: ``Auto``). .. code-block:: c++ if (a) - return ; + return; + + if (b) + return; + else + return; + + if (c) + return; else { return; } * ``SIS_WithoutElse`` (in configuration: ``WithoutElse``) - Without else put short ifs on the same line only if - the else is not a compound statement. + Put short ifs on the same line only if there is no else statement. .. code-block:: c++ if (a) return; + + if (b) + return; else return; - * ``SIS_Always`` (in configuration: ``Always``) - Always put short ifs on the same line if - the else is not a compound statement or not. + if (c) + return; + else { + return; + } + + * ``SIS_OnlyFirstIf`` (in configuration: ``OnlyFirstIf``) + Put short ifs, but not else ifs nor else statements, on the same line. .. code-block:: c++ if (a) return; + + if (b) return; + else if (b) + return; + else + return; + + if (c) return; + else { + return; + } + + * ``SIS_AllIfsAndElse`` (in configuration: ``AllIfsAndElse``) + Always put short ifs, else ifs and else statements on the same + line. + + .. code-block:: c++ + + if (a) return; + + if (b) return; + else return; + + if (c) return; else { return; } @@ -2176,8 +2215,11 @@ the configuration (without a prefix: ``Auto``). private: protected: + }; + + **EmptyLineBeforeAccessModifier** (``EmptyLineBeforeAccessModifierStyle``) Defines in which cases to put empty line before access modifiers. @@ -2245,6 +2287,8 @@ the configuration (without a prefix: ``Auto``). protected: }; + + **ExperimentalAutoDetectBinPacking** (``bool``) If ``true``, clang-format detects whether function calls and definitions are formatted with one parameter per line. @@ -3441,15 +3485,32 @@ the configuration (without a prefix: ``Auto``). } // foo } -**SpacesInAngles** (``bool``) - If ``true``, spaces will be inserted after ``<`` and before ``>`` - in template argument lists. +**SpacesInAngles** (``SpacesInAnglesStyle``) + The SpacesInAnglesStyle to use for template argument lists. + + Possible values: + + * ``SIAS_Never`` (in configuration: ``Never``) + Remove spaces after ``<`` and before ``>``. + + .. code-block:: c++ + + static_cast(arg); + std::function fct; + + * ``SIAS_Always`` (in configuration: ``Always``) + Add spaces after ``<`` and before ``>``. + + .. code-block:: c++ + + static_cast< int >(arg); + std::function< void(int) > fct; + + * ``SIAS_Leave`` (in configuration: ``Leave``) + Keep a single space after ``<`` and before ``>`` if any spaces were + present. Option ``Standard: Cpp03`` takes precedence. - .. code-block:: c++ - true: false: - static_cast< int >(arg); vs. static_cast(arg); - std::function< void(int) > fct; std::function fct; **SpacesInCStyleCastParentheses** (``bool``) If ``true``, spaces may be inserted into C style casts. -- 2.7.4