Turn warning into error. Minor incompatibility with GCC (for scalar types, GCC only produces a warning).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64375 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 989de0c..8b2e088 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -981,8 +981,7 @@
 }
 
 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 @@
     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();
     }
   }