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 | 438059e50964987db90b77e8c88fafae5d130543 (patch) | |
tree | d5311e686eff92582c571ff777cbf681b4e5d8fa /clang/lib/Format | |
parent | 0c7c78f1d1017e1c4ad70832d033827c2eabd5b4 (diff) | |
download | bcm5719-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/lib/Format')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 3 |
1 files changed, 2 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)); } |