aboutsummaryrefslogtreecommitdiff
path: root/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Parse/ParseObjc.cpp')
-rw-r--r--Parse/ParseObjc.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Parse/ParseObjc.cpp b/Parse/ParseObjc.cpp
index e661e8775b..c17e35e6f4 100644
--- a/Parse/ParseObjc.cpp
+++ b/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;
}