[clang] 8702c6d - [clang-format] [docs] Regenerate style options documentation.
Marek Kurdej via cfe-commits
cfe-commits at lists.llvm.org
Fri May 28 12:49:21 PDT 2021
Author: Marek Kurdej
Date: 2021-05-28T21:48:36+02:00
New Revision: 8702c6da162b6db962c8155195d79f1e002bc481
URL: https://github.com/llvm/llvm-project/commit/8702c6da162b6db962c8155195d79f1e002bc481
DIFF: https://github.com/llvm/llvm-project/commit/8702c6da162b6db962c8155195d79f1e002bc481.diff
LOG: [clang-format] [docs] Regenerate style options documentation.
Forgotten in commits fce8c10b, 9363aa90, 8d93d7ff.
Added:
Modified:
clang/docs/ClangFormatStyleOptions.rst
Removed:
################################################################################
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst
index 986963c8ce67c..459887705d4ec 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<int>(arg);
+ std::function<void(int)> 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<int>(arg);
- std::function< void(int) > fct; std::function<void(int)> fct;
**SpacesInCStyleCastParentheses** (``bool``)
If ``true``, spaces may be inserted into C style casts.
More information about the cfe-commits
mailing list