[PATCH] D139937: [clang-format] make doc for SLS_Inline more clearly
Zhikai Zeng via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 13 09:54:34 PST 2022
Backl1ght updated this revision to Diff 482530.
Backl1ght retitled this revision from "[clang-format] fix typo in doc for SLS_Inline" to "[clang-format] make doc for SLS_Inline more clearly".
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.482530.patch
Type: text/x-patch
Size: 1606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221213/085220dc/attachment.bin>
More information about the cfe-commits
mailing list