Get rid of special parsing for return statements.
This was done when we were not able to parse lambdas to handle some
edge cases for block formatting different in return statements, but is
not necessary any more.
llvm-svn: 199982
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 7b3ea6e..54a13b6 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -6479,14 +6479,18 @@
verifyFormat("void f() {\n"
" return g() {}\n"
" void h() {}");
- verifyFormat("if (foo)\n"
- " return { forgot_closing_brace();\n"
- "test();");
verifyFormat("int a[] = { void forgot_closing_brace() { f();\n"
"g();\n"
"}");
}
+TEST_F(FormatTest, DoNotPrematurelyEndUnwrappedLineForReturnStatements) {
+ verifyFormat(
+ "void f() {\n"
+ " return C{ param1, param2 }.SomeCall(param1, param2);\n"
+ "}\n");
+}
+
TEST_F(FormatTest, FormatsClosingBracesInEmptyNestedBlocks) {
verifyFormat("class X {\n"
" void f() {\n"