[PATCH] D139937: [clang-format] make doc for SLS_Inline more clearly

Zhikai Zeng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 15 05:09:06 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7b36538156b7: [clang-format] make doc for SLS_Inline more clearly (authored by Backl1ght).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139937

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
@@ -688,12 +688,12 @@
     ///   };
     /// \endcode
     SLS_Empty,
-    /// Merge lambda into a single line if argument of a function.
+    /// Merge lambda into a single line if the lambda is argument of a function.
     /// \code
-    ///   auto lambda = [](int a) {
-    ///       return a;
+    ///   auto lambda = [](int x, int y) {
+    ///       return x < y;
     ///   };
-    ///   sort(a.begin(), a.end(), []() { return x < y; });
+    ///   sort(a.begin(), a.end(), [](int x, int y) { return x < y; });
     /// \endcode
     SLS_Inline,
     /// Merge all lambdas fitting on a single line.
Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -1191,14 +1191,14 @@
       };
 
   * ``SLS_Inline`` (in configuration: ``Inline``)
-    Merge lambda into a single line if argument of a function.
+    Merge lambda into a single line if the lambda is argument of a function.
 
     .. code-block:: c++
 
-      auto lambda = [](int a) {
-          return a;
+      auto lambda = [](int x, int y) {
+          return x < y;
       };
-      sort(a.begin(), a.end(), []() { return x < y; });
+      sort(a.begin(), a.end(), [](int x, int y) { return x < y; });
 
   * ``SLS_All`` (in configuration: ``All``)
     Merge all lambdas fitting on a single line.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139937.483136.patch
Type: text/x-patch
Size: 1606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221215/ec94708a/attachment.bin>


More information about the cfe-commits mailing list