]> granicus.if.org Git - clang/commitdiff
[clang-format][docs][NFC] Fix example for Allman brace breaking style
authorJan Korous <jkorous@apple.com>
Tue, 5 Mar 2019 01:45:31 +0000 (01:45 +0000)
committerJan Korous <jkorous@apple.com>
Tue, 5 Mar 2019 01:45:31 +0000 (01:45 +0000)
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

docs/ClangFormatStyleOptions.rst

index ce821ba9c10f251cecd1a56ecaefd095f3870acd..582b9d938cc19dfc486e0e656f4c4145a04e1d69 100644 (file)
@@ -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