summaryrefslogtreecommitdiffstats
path: root/clang/Parse/Parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Parse/Parser.cpp')
-rw-r--r--clang/Parse/Parser.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/Parse/Parser.cpp b/clang/Parse/Parser.cpp
index 732311d6c2d..2e15cbde04b 100644
--- a/clang/Parse/Parser.cpp
+++ b/clang/Parse/Parser.cpp
@@ -374,8 +374,12 @@ Parser::DeclTy *Parser::ParseDeclarationOrFunctionDefinition() {
// ObjC2 allows prefix attributes on class interfaces.
if (getLang().ObjC2 && Tok.is(tok::at)) {
SourceLocation AtLoc = ConsumeToken(); // the "@"
- if (Tok.getIdentifierInfo()->getObjCKeywordID() == tok::objc_interface)
- return ParseObjCAtInterfaceDeclaration(AtLoc, DS.getAttributes());
+ if (!Tok.isObjCAtKeyword(tok::objc_interface)) {
+ Diag(Tok, diag::err_objc_expected_property_attr);//FIXME:better diagnostic
+ SkipUntil(tok::semi); // FIXME: better skip?
+ return 0;
+ }
+ return ParseObjCAtInterfaceDeclaration(AtLoc, DS.getAttributes());
}
// Parse the first declarator.
OpenPOWER on IntegriCloud