summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commit2827a7ec6b16e21ef1b447cf42066fba14c21dfc (patch)
tree0cbadea29fbb34fc08dbb8cdd04fe6cec0209074 /clang/lib
parent7e31c8f0ae5abb33028567461cbd3915303a49af (diff)
downloadbcm5719-llvm-2827a7ec6b16e21ef1b447cf42066fba14c21dfc.tar.gz
bcm5719-llvm-2827a7ec6b16e21ef1b447cf42066fba14c21dfc.zip
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]; llvm-svn: 172337
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/Format.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 94119325410..29debe58b6b 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud