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
--- /dev/null
+// RUN: clang -fsyntax-only -verify %s
+
+static int test_NSURLGetResourceValueForKey( id keys )
+{
+ for ( id key; in keys) { // expected-error {{parse error}}
+ }
+}