[cfe-commits] r68925 - in /cfe/trunk: lib/Sema/SemaStmt.cpp test/SemaObjC/exception-go-boom.m

Chris Lattner sabre at nondot.org
Sun Apr 12 16:26:58 PDT 2009


Author: lattner
Date: Sun Apr 12 18:26:56 2009
New Revision: 68925

URL: http://llvm.org/viewvc/llvm-project?rev=68925&view=rev
Log:
if we already know that a decl is invalid in an @catch, don't verify its type.

Modified:
    cfe/trunk/lib/Sema/SemaStmt.cpp
    cfe/trunk/test/SemaObjC/exception-go-boom.m

Modified: cfe/trunk/lib/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=68925&r1=68924&r2=68925&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Sun Apr 12 18:26:56 2009
@@ -1031,6 +1031,10 @@
   
   // PVD == 0 implies @catch(...).
   if (PVD) {
+    // If we already know the decl is invalid, reject it.
+    if (PVD->isInvalidDecl())
+      return StmtError();
+    
     if (!Context.isObjCObjectPointerType(PVD->getType()))
       return StmtError(Diag(PVD->getLocation(), 
                        diag::err_catch_param_not_objc_type));
@@ -1038,7 +1042,7 @@
       return StmtError(Diag(PVD->getLocation(), 
                        diag::err_illegal_qualifiers_on_catch_parm));
   }
-    
+
   ObjCAtCatchStmt *CS = new (Context) ObjCAtCatchStmt(AtLoc, RParen,
     PVD, static_cast<Stmt*>(Body.release()), CatchList);
   return Owned(CatchList ? CatchList : CS);

Modified: cfe/trunk/test/SemaObjC/exception-go-boom.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/exception-go-boom.m?rev=68925&r1=68924&r2=68925&view=diff

==============================================================================
--- cfe/trunk/test/SemaObjC/exception-go-boom.m (original)
+++ cfe/trunk/test/SemaObjC/exception-go-boom.m Sun Apr 12 18:26:56 2009
@@ -4,8 +4,7 @@
 void f0(id x) {
   @try {
   } @catch (NSException *x) { // \
-         expected-error{{unknown type name 'NSException'}} \
-         expected-error{{@catch parameter is not a pointer to an interface type}}
+         expected-error{{unknown type name 'NSException'}}
   }
 }
 





More information about the cfe-commits mailing list