From 89a13fcf4237b73a1c7c8f81dffc9d5c22db8b81 Mon Sep 17 00:00:00 2001 From: Jan Korous Date: Wed, 5 Jun 2019 20:59:48 +0000 Subject: [PATCH] [clang-format][NFC] Fix BS_Allman style example in the header docs are generated from Differential Revision: https://reviews.llvm.org/D61729 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362646 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/ClangFormatStyleOptions.rst | 21 +++++++++++++++------ include/clang/Format/Format.h | 21 +++++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst index 342ecc7914..8bd0e9c8f7 100644 --- a/docs/ClangFormatStyleOptions.rst +++ b/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/include/clang/Format/Format.h b/include/clang/Format/Format.h index af7c351d79..0aae75276f 100644 --- a/include/clang/Format/Format.h +++ b/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 -- 2.50.1