[PATCH] D61729: [docs] Fix example for Allman brace breaking style

Gerriet Backer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 9 06:38:04 PDT 2019


gerriet created this revision.
gerriet added reviewers: jkorous, llvm-commits.
Herald added subscribers: cfe-commits, dexonsmith.
Herald added a project: clang.

Commit 3fd4a968ad80 <https://reviews.llvm.org/rG3fd4a968ad80d603ea4dbd616c00824cf165e384> by @jkorous was wrongfully rolled back. Opening braces need to be on separate lines for Allman style.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61729

Files:
  clang/docs/ClangFormatStyleOptions.rst


Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1059,19 +1059,28 @@
 
     .. 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61729.198808.patch
Type: text/x-patch
Size: 767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190509/89f46908/attachment-0001.bin>


More information about the cfe-commits mailing list