diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-06-29 20:25:42 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-06-29 20:25:42 +0000 |
commit | e10c67f70407f31e1cc7fa9a5f8825adb0dfeef2 (patch) | |
tree | d1b123d67bfd581aa0449a8a3ec00e837824967f | |
parent | 12eb5d6aa882eb247a6c22225b625eee04217105 (diff) |
Add test case for <rdar://problem/4289832>. Clang actuallys gets
the test case right (for the noreturn warning) because the CFG
doesn't support @try yet, but the test case is now present when
we do properly implement CFG support for @try...@catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107203 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/SemaObjC/return.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaObjC/return.m b/test/SemaObjC/return.m index c578bf3b65..116abd19e7 100644 --- a/test/SemaObjC/return.m +++ b/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 + { + } +} + |