aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-01-12 23:48:49 +0000
committerNico Weber <nicolasweber@gmx.de>2013-01-12 23:48:49 +0000
commitcd458330d0cdced36a49f1d66cd9c5908f46d939 (patch)
tree8caf660412e79a8f2385cc0e373ada8f36c4a196 /lib/Format/Format.cpp
parent6292dd4be36f2dac5df121a8c81c043f6c6243cf (diff)
Formatter: Don't insert a space before unary operators after selector names.
Before: [color getRed: &r green: &g blue: &b alpha: &a]; Now: [color getRed:&r green:&g blue:&b alpha:&a]; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 9411932541..29debe58b6 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -1165,8 +1165,9 @@ private:
return false;
if (Tok.Type == TT_UnaryOperator)
return Tok.Parent->isNot(tok::l_paren) &&
- Tok.Parent->isNot(tok::l_square) &&
- Tok.Parent->isNot(tok::at);
+ Tok.Parent->isNot(tok::l_square) && Tok.Parent->isNot(tok::at) &&
+ (Tok.Parent->isNot(tok::colon) ||
+ Tok.Parent->Type != TT_ObjCMethodExpr);
if (Tok.Parent->is(tok::greater) && Tok.is(tok::greater)) {
return Tok.Type == TT_TemplateCloser && Tok.Parent->Type ==
TT_TemplateCloser && Style.SplitTemplateClosingGreater;