summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-07-14 11:26:14 +0000
committerDaniel Jasper <djasper@google.com>2015-07-14 11:26:14 +0000
commitf83c8a72dd70564bacaf2fb97d250262940111eb (patch)
treeda63f77d81602a76407fbdb7ede78e376b2fd44b /unittests
parent928084c346a98e965bd0ef7b43462f80d96db813 (diff)
downloadclang-f83c8a72dd70564bacaf2fb97d250262940111eb.tar.gz
clang-format: Fix formatting of multiple lambdas in initializers.
Before: SomeFunction({[&] { // comment }, [&] { // comment }}); After: SomeFunction({[&] { // comment }, [&] { // comment }}); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Format/FormatTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 6aa7681ac5..d61dc7f662 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -9866,6 +9866,15 @@ TEST_F(FormatTest, FormatsLambdas) {
" return aaaaaaaaaaaaaaaaaaaaaaa != aaaaaaaaaaaaaaaaaaaaaaa;\n"
"});",
getLLVMStyleWithColumns(60));
+ verifyFormat("SomeFunction({[&] {\n"
+ " // comment\n"
+ " },\n"
+ " [&] {\n"
+ " // comment\n"
+ " }});");
+ verifyFormat("SomeFunction({[&] {\n"
+ " // comment\n"
+ "}});");
// Lambdas with return types.
verifyFormat("int c = []() -> int { return 2; }();\n");