[cfe-commits] r107203 - /cfe/trunk/test/SemaObjC/return.m

Ted Kremenek kremenek at apple.com
Tue Jun 29 13:25:42 PDT 2010


Author: kremenek
Date: Tue Jun 29 15:25:42 2010
New Revision: 107203

URL: http://llvm.org/viewvc/llvm-project?rev=107203&view=rev
Log:
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... at catch.

Modified:
    cfe/trunk/test/SemaObjC/return.m

Modified: cfe/trunk/test/SemaObjC/return.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/return.m?rev=107203&r1=107202&r2=107203&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/return.m (original)
+++ cfe/trunk/test/SemaObjC/return.m Tue Jun 29 15:25:42 2010
@@ -20,3 +20,22 @@
       @throw (id)0;
   }
 }
+
+// <rdar://problem/4289832> - This code always returns, we should not
+//  issue a noreturn warning.
+ at class NSException;
+ at class NSString;
+NSString *rdar_4289832() {  // no-warning
+    @try
+    {
+        return @"a";
+    }
+    @catch(NSException *exception)
+    {
+        return @"b";
+    }
+    @finally
+    {
+    }
+}
+





More information about the cfe-commits mailing list