[cfe-commits] r64389 - /cfe/trunk/lib/Sema/SemaStmt.cpp

Steve Naroff snaroff at apple.com
Thu Feb 12 10:09:32 PST 2009


Author: snaroff
Date: Thu Feb 12 12:09:32 2009
New Revision: 64389

URL: http://llvm.org/viewvc/llvm-project?rev=64389&view=rev
Log:
Sema::ActOnObjCAtThrowStmt(): return from recently added errors. Thanks Chris!

Modified:
    cfe/trunk/lib/Sema/SemaStmt.cpp

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/lib/Sema/SemaStmt.cpp Thu Feb 12 12:09:32 2009
@@ -990,15 +990,15 @@
     while (AtCatchParent && !AtCatchParent->isAtCatchScope())
       AtCatchParent = AtCatchParent->getParent();
     if (!AtCatchParent)
-      Diag(AtLoc, diag::error_rethrow_used_outside_catch);
+      return StmtError(Diag(AtLoc, diag::error_rethrow_used_outside_catch));
   } else {
     QualType ThrowType = ThrowExpr->getType();
     // Make sure the expression type is an ObjC pointer or "void *".
     if (!Context.isObjCObjectPointerType(ThrowType)) {
       const PointerType *PT = ThrowType->getAsPointerType();
       if (!PT || !PT->getPointeeType()->isVoidType())
-        Diag(AtLoc, diag::error_objc_throw_expects_object)
-                    << ThrowExpr->getType() << ThrowExpr->getSourceRange();
+        return StmtError(Diag(AtLoc, diag::error_objc_throw_expects_object)
+                        << ThrowExpr->getType() << ThrowExpr->getSourceRange());
     }
   }
   return Owned(new (Context) ObjCAtThrowStmt(AtLoc, ThrowExpr));





More information about the cfe-commits mailing list