summaryrefslogtreecommitdiff
path: root/unittests/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-06-24 09:15:49 +0000
committerDaniel Jasper <djasper@google.com>2014-06-24 09:15:49 +0000
commitb3120c13de381215e4cf7d150cbee2a8e516ce85 (patch)
treeeec2f54113b6460e70efc1f157a64efc85a15cf2 /unittests/Format
parent9b31a3075faa589a6e16e5753b4c0897555dc02c (diff)
downloadclang-b3120c13de381215e4cf7d150cbee2a8e516ce85.tar.gz
clang-b3120c13de381215e4cf7d150cbee2a8e516ce85.tar.bz2
clang-b3120c13de381215e4cf7d150cbee2a8e516ce85.tar.xz
clang-format: Understand that breaking before lambdas is fine.
Before: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([]( const aaaaaaaaaa &a) { return a; }); After: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( [](const aaaaaaaaaa &a) { return a; }); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211575 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format')
-rw-r--r--unittests/Format/FormatTest.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 968e13b3fe..11a42a51fa 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -8721,6 +8721,8 @@ TEST_F(FormatTest, FormatsLambdas) {
verifyFormat("void f() {\n"
" SomeFunction([](decltype(x), A *a) {});\n"
"}");
+ verifyFormat("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
+ " [](const aaaaaaaaaa &a) { return a; });");
// Lambdas with return types.
verifyFormat("int c = []() -> int { return 2; }();\n");
@@ -8728,7 +8730,7 @@ TEST_F(FormatTest, FormatsLambdas) {
verifyFormat("Foo([]() -> std::vector<int> { return {2}; }());");
verifyFormat("auto aaaaaaaa = [](int i, // break for some reason\n"
" int j) -> int {\n"
- " return fffffffffffffffffffffffffffffffffffffff(i * j);\n"
+ " return ffffffffffffffffffffffffffffffffffffffffffff(i * j);\n"
"};");
// Multiple lambdas in the same parentheses change indentation rules.