summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-10-06 13:16:43 +0000
committerDaniel Jasper <djasper@google.com>2014-10-06 13:16:43 +0000
commita45eb4c000e2bd9bba49e31fed25c308a4961dd4 (patch)
tree06744fdc13d105cb8bd7a739cad3bbafd077a52b /clang/lib/Format
parenta117002d93b1f0e9488a68d5d3b540ca795bc9e5 (diff)
downloadbcm5719-llvm-a45eb4c000e2bd9bba49e31fed25c308a4961dd4.tar.gz
bcm5719-llvm-a45eb4c000e2bd9bba49e31fed25c308a4961dd4.zip
clang-format: If in doubt, assume '+' is a binary operator.
Before: #define LENGTH(x, y) (x) - (y)+1 After: #define LENGTH(x, y) (x) - (y) + 1 llvm-svn: 219119
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 43721ef95c0..4a964ed41d8 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -902,8 +902,9 @@ private:
if (Prev && Tok.Next && Tok.Next->Next) {
bool NextIsUnary = Tok.Next->isUnaryOperator() ||
Tok.Next->isOneOf(tok::amp, tok::star);
- IsCast = NextIsUnary && Tok.Next->Next->isOneOf(
- tok::identifier, tok::numeric_constant);
+ IsCast =
+ NextIsUnary && !Tok.Next->is(tok::plus) &&
+ Tok.Next->Next->isOneOf(tok::identifier, tok::numeric_constant);
}
for (; Prev != Tok.MatchingParen; Prev = Prev->Previous) {
OpenPOWER on IntegriCloud