Fix <rdar://problem/6206858> [sema] type check @throw statements.

Added a FIXME to handle 'rethrow' check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64308 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/objc-try-catch-1.m b/test/Parser/objc-try-catch-1.m
index 2e3c5b1..0e8a919 100644
--- a/test/Parser/objc-try-catch-1.m
+++ b/test/Parser/objc-try-catch-1.m
@@ -27,7 +27,7 @@
       return proc();
     }
     @catch (Frob* ex) {
-      @throw 1,2;
+      @throw 1,2; // expected-warning {{invalid 'int' argument (expected an ObjC object type)}}
     }
     @catch(...) {
       @throw (4,3,proc());
diff --git a/test/SemaObjC/try-catch.m b/test/SemaObjC/try-catch.m
index e4c20b7..00f1129 100644
--- a/test/SemaObjC/try-catch.m
+++ b/test/SemaObjC/try-catch.m
@@ -35,3 +35,9 @@
     // the exception name is optional (weird)
     @catch (NSException *) {}
 }
+@end
+
+int foo() {
+  @throw 42; // expected-warning {{invalid 'int' argument (expected an ObjC object type)}}
+  @throw; // FIXME: error: ‘@throw’ (rethrow) used outside of a @catch block
+}