clang-format: Fix bad merging of lines in nested blocks.
Before:
SomeFunction([]() {
#define A a
return 43; });
After:
SomeFunction([]() {
#define A a
return 43;
});
llvm-svn: 220684
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 5642b0f..f29aff8 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -9103,6 +9103,14 @@
verifyFormat("SomeFunction([]() { // A cool function...\n"
" return 43;\n"
"});");
+ EXPECT_EQ("SomeFunction([]() {\n"
+ "#define A a\n"
+ " return 43;\n"
+ "});",
+ format("SomeFunction([](){\n"
+ "#define A a\n"
+ "return 43;\n"
+ "});"));
verifyFormat("void f() {\n"
" SomeFunction([](decltype(x), A *a) {});\n"
"}");