From a45eb4c000e2bd9bba49e31fed25c308a4961dd4 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 6 Oct 2014 13:16:43 +0000 Subject: 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 --- clang/lib/Format/TokenAnnotator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Format') 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) { -- cgit v1.2.3