diff options
author | Daniel Jasper <djasper@google.com> | 2014-05-22 12:11:13 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-05-22 12:11:13 +0000 |
commit | 75ca7975d7e2207aa9cdcff0e1a8e9f7d89d956c (patch) | |
tree | 1c3a46b9aac5c4d447400169398efb589f0bbf6d /unittests/Format | |
parent | 0ae1b95f2fb62c33185dc25a93087b90f407ada8 (diff) | |
download | clang-75ca7975d7e2207aa9cdcff0e1a8e9f7d89d956c.tar.gz clang-75ca7975d7e2207aa9cdcff0e1a8e9f7d89d956c.tar.bz2 clang-75ca7975d7e2207aa9cdcff0e1a8e9f7d89d956c.tar.xz |
clang-format: Fix incorrect braced init identification.
Before:
int foo(int i) {
return fo1 {}
(i);
}
int foo(int i) {
return fo1 {}
(i);
}
After:
int foo(int i) { return fo1{}(i); }
int foo(int i) { return fo1{}(i); }
This fixes llvm.org/PR19812.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index af0b5a1cb6..f9016f4bf1 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -5263,6 +5263,9 @@ TEST_F(FormatTest, LayoutCxx11BraceInitializers) { "};"); verifyFormat("vector<int> foo = {::SomeGlobalFunction()};"); + verifyFormat("int foo(int i) { return fo1{}(i); }"); + verifyFormat("int foo(int i) { return fo1{}(i); }"); + // In combination with BinPackParameters = false. FormatStyle NoBinPacking = getLLVMStyle(); NoBinPacking.BinPackParameters = false; |