diff options
author | Daniel Jasper <djasper@google.com> | 2014-12-18 12:11:01 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-12-18 12:11:01 +0000 |
commit | 3a623dbd2af470264b9782b432a920a5837090dc (patch) | |
tree | cfcd5bd89a5417d9330d8f798cb443079ecd710b /clang/lib/Format/TokenAnnotator.cpp | |
parent | 07c0f04e08c840fc8bf1bfb8d5a2775b40c6e503 (diff) | |
download | bcm5719-llvm-3a623dbd2af470264b9782b432a920a5837090dc.tar.gz bcm5719-llvm-3a623dbd2af470264b9782b432a920a5837090dc.zip |
clang-format: Fix incorrect detection of ObjC "in" keyword.
Before:
for (auto v : in [1]) { ..
After:
for (auto v : in[1]) { ..
llvm-svn: 224513
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index deda40cab89..2e97ffffbec 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -511,7 +511,8 @@ private: parseTemplateDeclaration(); break; case tok::identifier: - if (Line.First->is(tok::kw_for) && Tok->is(Keywords.kw_in)) + if (Line.First->is(tok::kw_for) && Tok->is(Keywords.kw_in) && + Tok->Previous->isNot(tok::colon)) Tok->Type = TT_ObjCForIn; break; case tok::comma: |