[cfe-commits] r128325 - in /cfe/trunk: lib/Parse/ParseObjc.cpp test/Parser/recovery.m

John McCall rjmccall at apple.com
Fri Mar 25 18:53:26 PDT 2011


Author: rjmccall
Date: Fri Mar 25 20:53:26 2011
New Revision: 128325

URL: http://llvm.org/viewvc/llvm-project?rev=128325&view=rev
Log:
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.


Added:
    cfe/trunk/test/Parser/recovery.m
Modified:
    cfe/trunk/lib/Parse/ParseObjc.cpp

Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=128325&r1=128324&r2=128325&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Fri Mar 25 20:53:26 2011
@@ -442,8 +442,7 @@
       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;
     }
   }

Added: cfe/trunk/test/Parser/recovery.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/recovery.m?rev=128325&view=auto
==============================================================================
--- cfe/trunk/test/Parser/recovery.m (added)
+++ cfe/trunk/test/Parser/recovery.m Fri Mar 25 20:53:26 2011
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -fblocks %s
+
+ at interface Test0
+ at property (assign) id x  // expected-error {{expected ';' at end of declaration list}}
+ at end





More information about the cfe-commits mailing list