MissingDealloc.m revision 63de73635611b4cdc57eff94b36e9525b363281a
1// RUN: clang -warn-objc-missing-dealloc '-DIBOutlet=__attribute__((iboutlet))' %s --verify
2typedef signed char BOOL;
3@protocol NSObject  - (BOOL)isEqual:(id)object; @end
4@interface NSObject <NSObject> {}
5- (void)dealloc;
6- (id)init;
7@end
8
9typedef struct objc_selector *SEL;
10
11// <rdar://problem/6380411>: 'myproperty' has kind 'assign' and thus the
12//  assignment through the setter does not perform a release.
13
14@interface MyObject : NSObject {
15  id _myproperty;  
16}
17@property(assign) id myproperty;
18@end
19
20@implementation MyObject
21@synthesize myproperty=_myproperty; // no-warning
22- (void)dealloc {
23  self.myproperty = 0;
24  [super dealloc]; 
25}
26@end
27
28//===------------------------------------------------------------------------===
29//  Don't warn about iVars that are selectors.
30
31@interface TestSELs : NSObject {
32  SEL a;
33  SEL b;
34}
35
36@end
37
38@implementation TestSELs // no-warning
39- (id)init {
40  if( (self = [super init]) ) {
41    a = @selector(a);
42    b = @selector(b);
43  }
44
45  return self;
46}
47@end
48