diff options
-rw-r--r-- | clang/test/SemaObjC/return.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/return.m b/clang/test/SemaObjC/return.m index c578bf3b656..116abd19e7e 100644 --- a/clang/test/SemaObjC/return.m +++ b/clang/test/SemaObjC/return.m @@ -20,3 +20,22 @@ void test3(int a) { // expected-warning {{function could be attribute 'noreturn @throw (id)0; } } + +// <rdar://problem/4289832> - This code always returns, we should not +// issue a noreturn warning. +@class NSException; +@class NSString; +NSString *rdar_4289832() { // no-warning + @try + { + return @"a"; + } + @catch(NSException *exception) + { + return @"b"; + } + @finally + { + } +} + |