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.
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.
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits