forked from OSchip/llvm-project
parent
fbfaafc0a9
commit
94234ea63e
|
@ -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
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// RUN: clang -fsyntax-only -verify %s
|
||||
|
||||
static int test_NSURLGetResourceValueForKey( id keys )
|
||||
{
|
||||
for ( id key; in keys) { // expected-error {{parse error}}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue