summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-01-21 10:07:49 +0000
committerManuel Klimek <klimek@google.com>2013-01-21 10:07:49 +0000
commit762dd189a4c1c7db7b826d0e057edf980d7fe3ca (patch)
treec4f11e8c3f51524b316e3d21c7bd0db9569762c2 /clang/unittests/Format/FormatTest.cpp
parent3fd1260155750203f9cb6029ec1f5fa8fc4e4673 (diff)
downloadbcm5719-llvm-762dd189a4c1c7db7b826d0e057edf980d7fe3ca.tar.gz
bcm5719-llvm-762dd189a4c1c7db7b826d0e057edf980d7fe3ca.zip
Fix parsing of return statements.
Previously, we would not detect brace initializer lists in return statements, thus: return (a)(b) { 1, 2, 3 }; would put the semicolon onto the next line. llvm-svn: 173017
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index c9319d59390..1d3463ccfd2 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -1474,6 +1474,10 @@ TEST_F(FormatTest, LayoutCallsInsideBraceInitializers) {
"};", getLLVMStyleWithColumns(25));
}
+TEST_F(FormatTest, LayoutBraceInitializersInReturnStatement) {
+ verifyFormat("return (a)(b) { 1, 2, 3 };");
+}
+
TEST_F(FormatTest, LayoutTokensFollowingBlockInParentheses) {
verifyFormat(
"Aaa({\n"
OpenPOWER on IntegriCloud