diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp index 210f33a5f748..4e4d009fe06f 100644 --- a/clang/lib/Parse/ParseObjc.cpp +++ b/clang/lib/Parse/ParseObjc.cpp @@ -239,7 +239,8 @@ void Parser::ParseObjCInterfaceDeclList(DeclTy *interfaceDecl, allMethods.push_back(methodPrototype); // Consume the ';' here, since ParseObjCMethodPrototype() is re-used for // method definitions. - ExpectAndConsume(tok::semi, diag::err_expected_semi_after_method_proto); + ExpectAndConsume(tok::semi, diag::err_expected_semi_after_method_proto, + "", tok::semi); continue; } diff --git a/clang/test/Parser/objc-interfaces.m b/clang/test/Parser/objc-interfaces.m new file mode 100644 index 000000000000..b13eea59552c --- /dev/null +++ b/clang/test/Parser/objc-interfaces.m @@ -0,0 +1,8 @@ +// RUN: clang %s -fsyntax-only -verify + +// Test features and error recovery for objc interfaces. + +@interface INTF +- (int*) foo2 __attribute__((deprecated)) : (int) x1 __attribute__((deprecated)); // expected-error {{expected ';' after method prototype}} +@end +