summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-05-22 12:11:13 +0000
committerDaniel Jasper <djasper@google.com>2014-05-22 12:11:13 +0000
commit438059e50964987db90b77e8c88fafae5d130543 (patch)
treed5311e686eff92582c571ff777cbf681b4e5d8fa /clang/unittests/Format/FormatTest.cpp
parent0c7c78f1d1017e1c4ad70832d033827c2eabd5b4 (diff)
downloadbcm5719-llvm-438059e50964987db90b77e8c88fafae5d130543.tar.gz
bcm5719-llvm-438059e50964987db90b77e8c88fafae5d130543.zip
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. llvm-svn: 209428
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index af0b5a1cb61..f9016f4bf1a 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud