diff options
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 989de0cdbf..8b2e088b2e 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -981,8 +981,7 @@ Sema::ActOnObjCAtTryStmt(SourceLocation AtLoc, } Action::OwningStmtResult -Sema::ActOnObjCAtThrowStmt(SourceLocation AtLoc, ExprArg expr, - Scope *CurScope) { +Sema::ActOnObjCAtThrowStmt(SourceLocation AtLoc, ExprArg expr,Scope *CurScope) { Expr *ThrowExpr = static_cast<Expr*>(expr.release()); if (!ThrowExpr) { // @throw without an expression designates a rethrow (which much occur @@ -998,8 +997,7 @@ Sema::ActOnObjCAtThrowStmt(SourceLocation AtLoc, ExprArg expr, if (!Context.isObjCObjectPointerType(ThrowType)) { const PointerType *PT = ThrowType->getAsPointerType(); if (!PT || !PT->getPointeeType()->isVoidType()) - // This should be an error, however GCC only yields a warning. - Diag(AtLoc, diag::warn_objc_throw_expects_object) + Diag(AtLoc, diag::error_objc_throw_expects_object) << ThrowExpr->getType() << ThrowExpr->getSourceRange(); } } |