]> granicus.if.org Git - clang/commitdiff
Add another test case for the MissingDealloc checker.
authorTed Kremenek <kremenek@apple.com>
Tue, 10 Feb 2009 23:41:52 +0000 (23:41 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 10 Feb 2009 23:41:52 +0000 (23:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64257 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/MissingDealloc.m

index 3b16aa3feab7fdca1a5db35d0ff8ee492a81d0f8..c326eab300af22b79ab86a5117efb2ccd3077d25 100644 (file)
@@ -63,3 +63,23 @@ IBOutlet NSWindow *window;
 @implementation HasOutlet // no-warning
 @end
 
+//===------------------------------------------------------------------------===
+// <rdar://problem/6380411>
+// Was bogus warning: "The '_myproperty' instance variable was not retained by a
+//  synthesized property but was released in 'dealloc'"
+
+@interface MyObject_rdar6380411 : NSObject {
+    id _myproperty;
+}
+@property(assign) id myproperty;
+@end
+
+@implementation MyObject_rdar6380411
+@synthesize myproperty=_myproperty;
+- (void)dealloc {
+    // Don't claim that myproperty is released since it the property
+    // has the 'assign' attribute.
+    self.myproperty = 0; // no-warning
+    [super dealloc];
+}
+@end