Sema::ActOnObjCAtThrowStmt(): return from recently added errors. Thanks Chris!

llvm-svn: 64389
This commit is contained in:
Steve Naroff 2009-02-12 18:09:32 +00:00
parent 656b097b8a
commit c49b22a5c8
1 changed files with 3 additions and 3 deletions

View File

@ -990,15 +990,15 @@ Sema::ActOnObjCAtThrowStmt(SourceLocation AtLoc, ExprArg expr,Scope *CurScope) {
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));