r334709 - clang-format: Fix documentation generation

Francois Ferrand via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 14 06:32:14 PDT 2018


Author: typz
Date: Thu Jun 14 06:32:14 2018
New Revision: 334709

URL: http://llvm.org/viewvc/llvm-project?rev=334709&view=rev
Log:
clang-format: Fix documentation generation

Summary:
It seems that the changes done to `ClangFormatStyleOptions.rst` @334408 are causing the generation of the documentation to fail, with the following error:

  Warning, treated as error:
    /llvm/tools/clang/docs/ClangFormatStyleOptions.rst:1060: WARNING: Definition list ends without a blank line; unexpected unindent.

This is due to missing indent in some code block, and fixed by this patch.

Reviewers: krasimir, djasper, klimek

Reviewed By: krasimir

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D48161

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

Modified: cfe/trunk/docs/ClangFormatStyleOptions.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangFormatStyleOptions.rst?rev=334709&r1=334708&r2=334709&view=diff
==============================================================================
--- cfe/trunk/docs/ClangFormatStyleOptions.rst (original)
+++ cfe/trunk/docs/ClangFormatStyleOptions.rst Thu Jun 14 06:32:14 2018
@@ -1019,9 +1019,9 @@ the configuration (without a prefix: ``A
 
     .. code-block:: c++
 
-    Constructor()
-        : initializer1(),
-          initializer2()
+       Constructor()
+           : initializer1(),
+             initializer2()
 
   * ``BCIS_BeforeComma`` (in configuration: ``BeforeComma``)
     Break constructor initializers before the colon and commas, and align
@@ -1029,18 +1029,18 @@ the configuration (without a prefix: ``A
 
     .. code-block:: c++
 
-    Constructor()
-        : initializer1()
-        , initializer2()
+       Constructor()
+           : initializer1()
+           , initializer2()
 
   * ``BCIS_AfterColon`` (in configuration: ``AfterColon``)
     Break constructor initializers after the colon and commas.
 
     .. code-block:: c++
 
-    Constructor() :
-        initializer1(),
-        initializer2()
+       Constructor() :
+           initializer1(),
+           initializer2()
 
 
 
@@ -1054,10 +1054,10 @@ the configuration (without a prefix: ``A
 
     .. code-block:: c++
 
-    class Foo
-        : Base1,
-          Base2
-    {};
+       class Foo
+           : Base1,
+             Base2
+       {};
 
   * ``BILS_BeforeComma`` (in configuration: ``BeforeComma``)
     Break inheritance list before the colon and commas, and align
@@ -1065,18 +1065,20 @@ the configuration (without a prefix: ``A
 
     .. code-block:: c++
 
-    Constructor()
-        : initializer1()
-        , initializer2()
+       class Foo
+           : Base1
+           , Base2
+       {};
 
   * ``BILS_AfterColon`` (in configuration: ``AfterColon``)
     Break inheritance list after the colon and commas.
 
     .. code-block:: c++
 
-    Constructor() :
-        initializer1(),
-        initializer2()
+       class Foo :
+           Base1,
+           Base2
+       {};
 
 
 

Modified: cfe/trunk/include/clang/Format/Format.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=334709&r1=334708&r2=334709&view=diff
==============================================================================
--- cfe/trunk/include/clang/Format/Format.h (original)
+++ cfe/trunk/include/clang/Format/Format.h Thu Jun 14 06:32:14 2018
@@ -840,24 +840,24 @@ struct FormatStyle {
   enum BreakConstructorInitializersStyle {
     /// Break constructor initializers before the colon and after the commas.
     /// \code
-    /// Constructor()
-    ///     : initializer1(),
-    ///       initializer2()
+    ///    Constructor()
+    ///        : initializer1(),
+    ///          initializer2()
     /// \endcode
     BCIS_BeforeColon,
     /// Break constructor initializers before the colon and commas, and align
     /// the commas with the colon.
     /// \code
-    /// Constructor()
-    ///     : initializer1()
-    ///     , initializer2()
+    ///    Constructor()
+    ///        : initializer1()
+    ///        , initializer2()
     /// \endcode
     BCIS_BeforeComma,
     /// Break constructor initializers after the colon and commas.
     /// \code
-    /// Constructor() :
-    ///     initializer1(),
-    ///     initializer2()
+    ///    Constructor() :
+    ///        initializer1(),
+    ///        initializer2()
     /// \endcode
     BCIS_AfterColon
   };
@@ -897,25 +897,27 @@ struct FormatStyle {
   enum BreakInheritanceListStyle {
     /// Break inheritance list before the colon and after the commas.
     /// \code
-    /// class Foo
-    ///     : Base1,
-    ///       Base2
-    /// {};
+    ///    class Foo
+    ///        : Base1,
+    ///          Base2
+    ///    {};
     /// \endcode
     BILS_BeforeColon,
     /// Break inheritance list before the colon and commas, and align
     /// the commas with the colon.
     /// \code
-    /// Constructor()
-    ///     : initializer1()
-    ///     , initializer2()
+    ///    class Foo
+    ///        : Base1
+    ///        , Base2
+    ///    {};
     /// \endcode
     BILS_BeforeComma,
     /// Break inheritance list after the colon and commas.
     /// \code
-    /// Constructor() :
-    ///     initializer1(),
-    ///     initializer2()
+    ///    class Foo :
+    ///        Base1,
+    ///        Base2
+    ///    {};
     /// \endcode
     BILS_AfterColon
   };




More information about the cfe-commits mailing list