Fix layout of lambda captures.
Before:
int c = [ &, &a, a]{
[ =, c, &d]{
return b++;
}();
}();
After:
int c = [&, &a, a] {
[=, c, &d] {
return b++;
}();
}();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189924 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index e9bf2c5..3d2cf13 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -6262,37 +6262,37 @@
// parsing of the unwrapped lines doesn't regress.
verifyFormat(
"int c = [b]() mutable {\n"
- " return [&b]{\n"
+ " return [&b] {\n"
" return b++;\n"
" }();\n"
"}();\n");
verifyFormat(
- "int c = [&]{\n"
- " [ = ]{\n"
+ "int c = [&] {\n"
+ " [=] {\n"
" return b++;\n"
" }();\n"
"}();\n");
verifyFormat(
- "int c = [ &, &a, a]{\n"
- " [ =, c, &d]{\n"
+ "int c = [&, &a, a] {\n"
+ " [=, c, &d] {\n"
" return b++;\n"
" }();\n"
"}();\n");
verifyFormat(
- "int c = [&a, &a, a]{\n"
- " [ =, a, b, &c]{\n"
+ "int c = [&a, &a, a] {\n"
+ " [=, a, b, &c] {\n"
" return b++;\n"
" }();\n"
"}();\n");
verifyFormat(
- "auto c = {[&a, &a, a]{\n"
- " [ =, a, b, &c]{\n"
+ "auto c = {[&a, &a, a] {\n"
+ " [=, a, b, &c] {\n"
" return b++;\n"
" }();\n"
"} }\n");
verifyFormat(
- "auto c = {[&a, &a, a]{\n"
- " [ =, a, b, &c]{\n"
+ "auto c = {[&a, &a, a] {\n"
+ " [=, a, b, &c] {\n"
" }();\n"
"} }\n");
}