From: John McCall Date: Sat, 26 Mar 2011 01:53:26 +0000 (+0000) Subject: Fix the recovery from missing semis on @property declarations to not consume X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7da19ea50d4161fcda40d135735bcf450cabeb50;p=clang Fix the recovery from missing semis on @property declarations to not consume the following '@'. Conceivably, we could skip tokens until something that can validly start an @interface declaration here, but it's not clear that it matters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128325 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 14f2bbedbe..d17e517b1f 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -442,8 +442,7 @@ void Parser::ParseObjCInterfaceDeclList(Decl *interfaceDecl, DeclSpec DS(AttrFactory); ParseStructDeclaration(DS, Callback); - ExpectAndConsume(tok::semi, diag::err_expected_semi_decl_list, "", - tok::at); + ExpectAndConsume(tok::semi, diag::err_expected_semi_decl_list); break; } } diff --git a/test/Parser/recovery.m b/test/Parser/recovery.m new file mode 100644 index 0000000000..e1265262b1 --- /dev/null +++ b/test/Parser/recovery.m @@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -fblocks %s + +@interface Test0 +@property (assign) id x // expected-error {{expected ';' at end of declaration list}} +@end