Index: test/Analysis/MissingDealloc.m =================================================================== --- test/Analysis/MissingDealloc.m +++ test/Analysis/MissingDealloc.m @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.Dealloc %s -verify -// expected-no-diagnostics + typedef signed char BOOL; @protocol NSObject - (BOOL)isEqual:(id)object; @@ -13,6 +13,18 @@ typedef struct objc_selector *SEL; +//===------------------------------------------------------------------------=== +// Warn about missing -dealloc method. + +@interface MissingDeallocWithIvar : NSObject { + NSObject *_ivar; +} +@end + +@implementation MissingDeallocWithIvar // expected-warning {{Objective-C class 'MissingDeallocWithIvar' lacks a 'dealloc' instance method}} +@end + +//===------------------------------------------------------------------------=== // : 'myproperty' has kind 'assign' and thus the // assignment through the setter does not perform a release. @@ -26,7 +38,7 @@ @synthesize myproperty=_myproperty; // no-warning - (void)dealloc { self.myproperty = 0; - [super dealloc]; + [super dealloc]; } @end