Issue diagnostic when objective-c's @interface is preceeded by a type specifier.

llvm-svn: 45491
This commit is contained in:
Fariborz Jahanian 2008-01-02 19:17:38 +00:00
parent 796b64337b
commit 056e3a4e90
2 changed files with 7 additions and 0 deletions

View File

@ -379,6 +379,9 @@ Parser::DeclTy *Parser::ParseDeclarationOrFunctionDefinition() {
SkipUntil(tok::semi); // FIXME: better skip?
return 0;
}
const char *PrevSpec = 0;
if (DS.SetTypeSpecType(DeclSpec::TST_unspecified, AtLoc, PrevSpec))
Diag(AtLoc, diag::err_invalid_decl_spec_combination, PrevSpec);
return ParseObjCAtInterfaceDeclaration(AtLoc, DS.getAttributes());
}

View File

@ -0,0 +1,4 @@
// RUN: clang -fsyntax-only -verify %s
int @interface bla ; // expected-error {{cannot combine with previous 'int' declaration specifier}}
@end