summaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-04-24 23:23:47 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-04-24 23:23:47 +0000
commit51c30afe7e2eb9273dd706229f42d87524fb8660 (patch)
treeffcac646113865d987668b2b3b8bbae22edd61b5 /lib/Parse/ParseObjc.cpp
parent80abce3d1597edaf427f65ce15d8433f3f13315d (diff)
downloadclang-51c30afe7e2eb9273dd706229f42d87524fb8660.tar.gz
clang-51c30afe7e2eb9273dd706229f42d87524fb8660.tar.bz2
clang-51c30afe7e2eb9273dd706229f42d87524fb8660.tar.xz
Objective-C parsing [qoi]: Recover gracefully with good diagnostic
when class implementation declaration adds protocol qualifier list. // rdar://12233858 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 23afa4ff3d..aa9c05ec7f 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -1565,6 +1565,13 @@ Parser::ParseObjCAtImplementationDeclaration(SourceLocation AtLoc) {
if (Tok.is(tok::l_brace)) // we have ivars
ParseObjCClassInstanceVariables(ObjCImpDecl, tok::objc_private, AtLoc);
+ else if (Tok.is(tok::less)) { // we have illegal '<' try to recover
+ Diag(Tok, diag::err_unexpected_protocol_qualifier);
+ // try to recover.
+ AttributeFactory attr;
+ DeclSpec DS(attr);
+ (void)ParseObjCProtocolQualifiers(DS);
+ }
}
assert(ObjCImpDecl);