summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-10-07 15:09:08 +0000
committerDaniel Jasper <djasper@google.com>2015-10-07 15:09:08 +0000
commit9cb1ac28b93d004941dc1ff3efc7b5464b1a2838 (patch)
tree53526bccca9d868122cbcb35a43049b71a113303 /clang/lib
parent39828256b0b0ba6648de1d55c0c3d7412ea162da (diff)
downloadbcm5719-llvm-9cb1ac28b93d004941dc1ff3efc7b5464b1a2838.tar.gz
bcm5719-llvm-9cb1ac28b93d004941dc1ff3efc7b5464b1a2838.zip
clang-format: Fixed missing space between Obj-C for/in and a typecast.
Fixes this bug: https://llvm.org/bugs/show_bug.cgi?id=24504 TokenAnnotator::spaceRequiredBetween was handling TT_ForEachMacro but not TT_ObjCForIn, so lines that look like: for (id nextObject in (NSArray *)myArray) would incorrectly turn into: for (id nextObject in(NSArray *)myArray) Patch by Kent Sutherland, thank you. llvm-svn: 249553
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index e9a78d8f661..bcd50a88bcd 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1902,7 +1902,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
return Line.Type == LT_ObjCDecl || Left.is(tok::semi) ||
(Style.SpaceBeforeParens != FormatStyle::SBPO_Never &&
(Left.isOneOf(tok::kw_if, tok::pp_elif, tok::kw_for, tok::kw_while,
- tok::kw_switch, tok::kw_case, TT_ForEachMacro) ||
+ tok::kw_switch, tok::kw_case, TT_ForEachMacro,
+ TT_ObjCForIn) ||
(Left.isOneOf(tok::kw_try, Keywords.kw___except, tok::kw_catch,
tok::kw_new, tok::kw_delete) &&
(!Left.Previous || Left.Previous->isNot(tok::period))))) ||
OpenPOWER on IntegriCloud