diff options
| -rw-r--r-- | clang/docs/ClangFormatStyleOptions.rst | 21 | ||||
| -rw-r--r-- | clang/include/clang/Format/Format.h | 21 |
2 files changed, 30 insertions, 12 deletions
diff --git a/clang/docs/ClangFormatStyleOptions.rst b/clang/docs/ClangFormatStyleOptions.rst index 342ecc7914a..8bd0e9c8f7e 100644 --- a/clang/docs/ClangFormatStyleOptions.rst +++ b/clang/docs/ClangFormatStyleOptions.rst @@ -1059,19 +1059,28 @@ the configuration (without a prefix: ``Auto``). .. code-block:: c++ - try { + try + { foo(); } - catch () { + catch () + { } void foo() { bar(); } - class foo { + class foo + { }; - if (foo()) { + if (foo()) + { } - else { + else + { } - enum X : int { A, B }; + enum X : int + { + A, + B + }; * ``BS_GNU`` (in configuration: ``GNU``) Always break before braces and add an extra level of indentation to diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h index af7c351d79b..0aae75276fa 100644 --- a/clang/include/clang/Format/Format.h +++ b/clang/include/clang/Format/Format.h @@ -642,19 +642,28 @@ struct FormatStyle { BS_Stroustrup, /// Always break before braces. /// \code - /// try { + /// try + /// { /// foo(); /// } - /// catch () { + /// catch () + /// { /// } /// void foo() { bar(); } - /// class foo { + /// class foo + /// { /// }; - /// if (foo()) { + /// if (foo()) + /// { /// } - /// else { + /// else + /// { /// } - /// enum X : int { A, B }; + /// enum X : int + /// { + /// A, + /// B + /// }; /// \endcode BS_Allman, /// Always break before braces and add an extra level of indentation to |

