Fix layout of lambda captures.
Before:
int c = [ &, &a, a]{
[ =, c, &d]{
return b++;
}();
}();
After:
int c = [&, &a, a] {
[=, c, &d] {
return b++;
}();
}();
llvm-svn: 189924
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index e9bf2c5..3d2cf13 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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");
}