summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-10-12 03:19:07 +0000
committerDaniel Jasper <djasper@google.com>2015-10-12 03:19:07 +0000
commit4d72449de6802a3676cdeab9bf902dc7a52d2333 (patch)
treecb1bc0462b3467f2e98d5e36cf7d53433dd629be /clang/lib/Format/TokenAnnotator.cpp
parent8d0e223498ab523a7668a5e2f3b0cb4849678347 (diff)
downloadbcm5719-llvm-4d72449de6802a3676cdeab9bf902dc7a52d2333.tar.gz
bcm5719-llvm-4d72449de6802a3676cdeab9bf902dc7a52d2333.zip
clang-format: Fixed typecast getting put on a separate line from the
key in Obj-C dictionary literals This fixes: https://llvm.org/PR22647 Patch by Kent Sutherland. Thank you. llvm-svn: 250010
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index bcd50a88bcd..fc89d2bafff 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -372,7 +372,9 @@ private:
updateParameterCount(Left, CurrentToken);
if (CurrentToken->isOneOf(tok::colon, tok::l_brace)) {
FormatToken *Previous = CurrentToken->getPreviousNonComment();
- if ((CurrentToken->is(tok::colon) ||
+ if (((CurrentToken->is(tok::colon) &&
+ (!Contexts.back().ColonIsDictLiteral ||
+ Style.Language != FormatStyle::LK_Cpp)) ||
Style.Language == FormatStyle::LK_Proto) &&
Previous->Tok.getIdentifierInfo())
Previous->Type = TT_SelectorName;
OpenPOWER on IntegriCloud