[PATCH] D53520: Update the example of BS_Stroustrup to match what is done by clang-format

Phabricator via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 26 00:29:33 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL345371: Update the example of BS_Stroustrup to match what is done by clang-format (authored by sylvestre, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D53520

Files:
  cfe/trunk/docs/ClangFormatStyleOptions.rst
  cfe/trunk/include/clang/Format/Format.h


Index: cfe/trunk/docs/ClangFormatStyleOptions.rst
===================================================================
--- cfe/trunk/docs/ClangFormatStyleOptions.rst
+++ cfe/trunk/docs/ClangFormatStyleOptions.rst
@@ -908,20 +908,17 @@
 
       try {
         foo();
-      } catch () {
+      }
+      catch () {
       }
       void foo() { bar(); }
-      class foo
-      {
+      class foo {
       };
       if (foo()) {
-      } else {
       }
-      enum X : int
-      {
-        A,
-        B
-      };
+      else {
+      }
+      enum X : int { A, B };
 
   * ``BS_Allman`` (in configuration: ``Allman``)
     Always break before braces.
Index: cfe/trunk/include/clang/Format/Format.h
===================================================================
--- cfe/trunk/include/clang/Format/Format.h
+++ cfe/trunk/include/clang/Format/Format.h
@@ -533,20 +533,17 @@
     /// \code
     ///   try {
     ///     foo();
-    ///   } catch () {
+    ///   }
+    ///   catch () {
     ///   }
     ///   void foo() { bar(); }
-    ///   class foo
-    ///   {
+    ///   class foo {
     ///   };
     ///   if (foo()) {
-    ///   } else {
     ///   }
-    ///   enum X : int
-    ///   {
-    ///     A,
-    ///     B
-    ///   };
+    ///   else {
+    ///   }
+    ///   enum X : int { A, B };
     /// \endcode
     BS_Stroustrup,
     /// Always break before braces.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53520.171254.patch
Type: text/x-patch
Size: 1382 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181026/e1cfcfd7/attachment.bin>


More information about the cfe-commits mailing list