diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Parser/objc-try-catch-1.m | 2 | ||||
| -rw-r--r-- | clang/test/SemaObjC/try-catch.m | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/test/Parser/objc-try-catch-1.m b/clang/test/Parser/objc-try-catch-1.m index 2e3c5b14a33..0e8a91977d3 100644 --- a/clang/test/Parser/objc-try-catch-1.m +++ b/clang/test/Parser/objc-try-catch-1.m @@ -27,7 +27,7 @@ void * foo() 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/clang/test/SemaObjC/try-catch.m b/clang/test/SemaObjC/try-catch.m index e4c20b73438..00f1129d31b 100644 --- a/clang/test/SemaObjC/try-catch.m +++ b/clang/test/SemaObjC/try-catch.m @@ -35,3 +35,9 @@ typedef struct _NSZone NSZone; // 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 +} |

