diff --git a/clang/Parse/Parser.cpp b/clang/Parse/Parser.cpp index c5a21c72b614..04cfea6f07a0 100644 --- a/clang/Parse/Parser.cpp +++ b/clang/Parse/Parser.cpp @@ -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()); } diff --git a/clang/test/Parser/check-syntax-1.m b/clang/test/Parser/check-syntax-1.m new file mode 100644 index 000000000000..9036c65dce55 --- /dev/null +++ b/clang/test/Parser/check-syntax-1.m @@ -0,0 +1,4 @@ +// RUN: clang -fsyntax-only -verify %s + +int @interface bla ; // expected-error {{cannot combine with previous 'int' declaration specifier}} +@end