aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-02 08:57:10 +0000
committerDaniel Jasper <djasper@google.com>2013-01-02 08:57:10 +0000
commit5d334407e68e45e3e7baa0cd140d4fd75e7483d6 (patch)
tree7d67fa0880ffb8d2dbc58f353bac125345cefe12 /lib/Format/Format.cpp
parent4dc41def6129bcecd4d08e5ffafe021aa7b1fa2a (diff)
Understand * and & in ternary expressions.
Before: "int a = b ? *c : * d;" After: "int a = b ? *c : *d; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171358 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index a6c11dcd7a..b304e2bf3d 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -806,6 +806,7 @@ private:
if (Index == 0 || Line.Tokens[Index - 1].Tok.is(tok::l_paren) ||
Line.Tokens[Index - 1].Tok.is(tok::comma) ||
Line.Tokens[Index - 1].Tok.is(tok::kw_return) ||
+ Line.Tokens[Index - 1].Tok.is(tok::colon) ||
Annotations[Index - 1].Type == TokenAnnotation::TT_BinaryOperator)
return TokenAnnotation::TT_UnaryOperator;