aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Parse/Parser.cpp3
-rw-r--r--test/Parser/check-syntax-1.m4
2 files changed, 7 insertions, 0 deletions
diff --git a/Parse/Parser.cpp b/Parse/Parser.cpp
index c5a21c72b6..04cfea6f07 100644
--- a/Parse/Parser.cpp
+++ b/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/test/Parser/check-syntax-1.m b/test/Parser/check-syntax-1.m
new file mode 100644
index 0000000000..9036c65dce
--- /dev/null
+++ b/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