[PATCH] D31574: [clang-format] update documentation

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 24 13:13:21 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG23b78364150c: [clang-format] update documentation (authored by MyDeveloperDay).

Changed prior to commit:
  https://reviews.llvm.org/D31574?vs=223443&id=226316#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D31574/new/

https://reviews.llvm.org/D31574

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


Index: clang/include/clang/Format/Format.h
===================================================================
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -782,7 +782,7 @@
   /// The brace breaking style to use.
   BraceBreakingStyle BreakBeforeBraces;
 
-  // Different ways to wrap braces after control statements.
+  /// Different ways to wrap braces after control statements.
   enum BraceWrappingAfterControlStatementStyle {
     /// Never wrap braces after a control statement.
     /// \code
@@ -1077,6 +1077,16 @@
   bool BreakAfterJavaFieldAnnotations;
 
   /// Allow breaking string literals when formatting.
+  /// \code
+  ///    true:
+  ///    const char* x = "veryVeryVeryVeryVeryVe"
+  ///                    "ryVeryVeryVeryVeryVery"
+  ///                    "VeryLongString";
+  ///
+  ///    false:
+  ///    const char* x =
+  ///      "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongString";
+  /// \endcode
   bool BreakStringLiterals;
 
   /// The column limit.
@@ -1985,7 +1995,6 @@
     /// Latest: Parse and format using the latest supported language version.
     /// 'Cpp11' is an alias for LS_Latest for historical reasons.
     LS_Latest,
-
     /// Auto: Automatic detection based on the input.
     /// Parse using the latest language version. Format based on detected input.
     LS_Auto,
Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1321,6 +1321,17 @@
 **BreakStringLiterals** (``bool``)
   Allow breaking string literals when formatting.
 
+  .. code-block:: c++
+
+     true:
+     const char* x = "veryVeryVeryVeryVeryVe"
+                     "ryVeryVeryVeryVeryVery"
+                     "VeryLongString";
+
+     false:
+     const char* x =
+       "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongString";
+
 **ColumnLimit** (``unsigned``)
   The column limit.
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31574.226316.patch
Type: text/x-patch
Size: 2013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191024/d029a54e/attachment.bin>


More information about the cfe-commits mailing list