summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Format/UnwrappedLineParser.cpp3
-rw-r--r--unittests/Format/FormatTest.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp
index 0585442550..e0106d94cf 100644
--- a/lib/Format/UnwrappedLineParser.cpp
+++ b/lib/Format/UnwrappedLineParser.cpp
@@ -348,7 +348,8 @@ void UnwrappedLineParser::calculateBraceTypes() {
// We exclude + and - as they can be ObjC visibility modifiers.
ProbablyBracedList =
NextTok->isOneOf(tok::comma, tok::semi, tok::period, tok::colon,
- tok::r_paren, tok::r_square, tok::l_brace) ||
+ tok::r_paren, tok::r_square, tok::l_brace,
+ tok::l_paren) ||
(NextTok->isBinaryOperator() &&
!NextTok->isOneOf(tok::plus, tok::minus));
}
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;