diff options
author | Manuel Klimek <klimek@google.com> | 2013-01-21 10:07:49 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2013-01-21 10:07:49 +0000 |
commit | 762dd189a4c1c7db7b826d0e057edf980d7fe3ca (patch) | |
tree | c4f11e8c3f51524b316e3d21c7bd0db9569762c2 /clang/unittests/Format/FormatTest.cpp | |
parent | 3fd1260155750203f9cb6029ec1f5fa8fc4e4673 (diff) | |
download | bcm5719-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.cpp | 4 |
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" |