From: Jan Korous Date: Tue, 5 Mar 2019 01:45:31 +0000 (+0000) Subject: [clang-format][docs][NFC] Fix example for Allman brace breaking style X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f832213b09546159e9639739afbb5ddc0b55d330;p=clang [clang-format][docs][NFC] Fix example for Allman brace breaking style I assume the example is wrong as it's clearly missing line-breaks before braces. I just ran the example through clang-format with .clang-format like this: BreakBeforeBraces: Allman Differential Revision: https://reviews.llvm.org/D58941 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355365 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst index ce821ba9c1..582b9d938c 100644 --- a/docs/ClangFormatStyleOptions.rst +++ b/docs/ClangFormatStyleOptions.rst @@ -925,19 +925,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