diff options
Diffstat (limited to 'docs/ClangFormatStyleOptions.rst')
-rw-r--r-- | docs/ClangFormatStyleOptions.rst | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst index 582b9d938c..d4a56d3bb3 100644 --- a/docs/ClangFormatStyleOptions.rst +++ b/docs/ClangFormatStyleOptions.rst @@ -365,10 +365,47 @@ the configuration (without a prefix: ``Auto``). }; void f() { bar(); } +**AllowShortIfStatementsOnASingleLine** (``ShortIfStyle``) + Dependent on the value, ``if (a) return 0;`` can be put on a + single line. + + Possible values: + + * ``SIS_Never`` (in configuration: ``Never``) + Do not allow short if functions. + + .. code-block:: c++ + + if (a) + return; + else + return; + + * ``SIS_WithoutElse`` (in configuration: ``WithoutElse``) + Allow short if functions on the same line, as long as else + is not a compound statement. + .. code-block:: c++ + + if (a) return; + else + return; + + if (a) + return; + else { + return; + } -**AllowShortIfStatementsOnASingleLine** (``bool``) - If ``true``, ``if (a) return;`` can be put on a single line. + * ``SIS_Always`` (in configuration: ``Always``) + Allow short if statements even if the else is a compound statement. + + .. code-block:: c++ + + if (a) return; + else { + return; + } **AllowShortLoopsOnASingleLine** (``bool``) If ``true``, ``while (true) continue;`` can be put on a single |