summaryrefslogtreecommitdiffstats
path: root/clang/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Parse/ParseObjc.cpp')
-rw-r--r--clang/Parse/ParseObjc.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/Parse/ParseObjc.cpp b/clang/Parse/ParseObjc.cpp
index e661e8775b2..c17e35e6f49 100644
--- a/clang/Parse/ParseObjc.cpp
+++ b/clang/Parse/ParseObjc.cpp
@@ -494,7 +494,10 @@ bool Parser::isObjCPropertyAttribute() {
/// objc-for-collection-in: 'in'
///
bool Parser::isObjCForCollectionInKW() {
- if (Tok.is(tok::identifier)) {
+ // FIXME: May have to do additional look-ahead to only allow for
+ // valid tokens following an 'in'; such as an identifier, unary operators,
+ // '[' etc.
+ if (getLang().ObjC2 && Tok.is(tok::identifier)) {
const IdentifierInfo *II = Tok.getIdentifierInfo();
return II == ObjCForCollectionInKW;
}
OpenPOWER on IntegriCloud