]> granicus.if.org Git - clang/commitdiff
Fix the recovery from missing semis on @property declarations to not consume
authorJohn McCall <rjmccall@apple.com>
Sat, 26 Mar 2011 01:53:26 +0000 (01:53 +0000)
committerJohn McCall <rjmccall@apple.com>
Sat, 26 Mar 2011 01:53:26 +0000 (01:53 +0000)
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

lib/Parse/ParseObjc.cpp
test/Parser/recovery.m [new file with mode: 0644]

index 14f2bbedbe2f222faf1d093d9fa73efa6ec2791e..d17e517b1f03d88ddbc6059f10e9db8097aaafb9 100644 (file)
@@ -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 (file)
index 0000000..e126526
--- /dev/null
@@ -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