aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 8d4705a7bf..be929ae067 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -364,6 +364,11 @@ ParseInitDeclaratorListAfterFirstDeclarator(Declarator &D) {
if (Tok.is(tok::semi)) {
ConsumeToken();
+ // for(is key; in keys) is error.
+ if (D.getContext() == Declarator::ForContext && isTokIdentifier_in()) {
+ Diag(Tok, diag::err_parse_error);
+ return 0;
+ }
return Actions.FinalizeDeclaratorGroup(CurScope, LastDeclInGroup);
}
// If this is an ObjC2 for-each loop, this is a successful declarator