diff options
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 3 | ||||
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 05854425503..e0106d94cf8 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/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/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; |

