diff options
author | Daniel Jasper <djasper@google.com> | 2013-11-22 07:26:53 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-11-22 07:26:53 +0000 |
commit | b631d5e6f3de87697b88829f312e55d947f2c760 (patch) | |
tree | b00cfb027e1206dbdab67555dc19bcac542d1457 /clang/unittests/Format/FormatTest.cpp | |
parent | 983f94a2b68eb6d650b4f769a3040abe9f40e420 (diff) | |
download | bcm5719-llvm-b631d5e6f3de87697b88829f312e55d947f2c760.tar.gz bcm5719-llvm-b631d5e6f3de87697b88829f312e55d947f2c760.zip |
clang-format: Recognize braced lists with trailing function call.
Before:
int count = set<int> { f(), g(), h() }
.size();
After:
int count = set<int>{f(), g(), h()}.size();
llvm-svn: 195417
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index ab3303ea928..b0b1c0f5615 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -4671,6 +4671,7 @@ TEST_F(FormatTest, LayoutCxx11ConstructorBraceInitializers) { verifyFormat("new int[3]{ 1, 2, 3 };"); verifyFormat("return { arg1, arg2 };"); verifyFormat("return { arg1, SomeType{ parameter } };"); + verifyFormat("int count = set<int>{ f(), g(), h() }.size();"); verifyFormat("new T{ arg1, arg2 };"); verifyFormat("f(MyMap[{ composite, key }]);"); verifyFormat("class Class {\n" @@ -4706,6 +4707,7 @@ TEST_F(FormatTest, LayoutCxx11ConstructorBraceInitializers) { verifyFormat("new int[3]{1, 2, 3};", NoSpaces); verifyFormat("return {arg1, arg2};", NoSpaces); verifyFormat("return {arg1, SomeType{parameter}};", NoSpaces); + verifyFormat("int count = set<int>{f(), g(), h()}.size();", NoSpaces); verifyFormat("new T{arg1, arg2};", NoSpaces); verifyFormat("f(MyMap[{composite, key}]);", NoSpaces); verifyFormat("class Class {\n" |