blob: 19c6b62577ea0a08a3a7c55a96ccfe318295e3a0 [file] [log] [blame]
Nico Weber9a1ecf02011-08-22 17:25:57 +00001@protocol NSCopying @end
2
3@interface NSObject <NSCopying>
4- (void)dealloc;
5@end
6
7@implementation NSObject
8- (void)dealloc {
9 // Root class, shouldn't warn
10}
11@end
12
13@interface Subclass1 : NSObject
14- (void)dealloc;
15@end
16
17@implementation Subclass1
18- (void)dealloc {
Ted Kremenek4eb14ca2011-08-22 19:07:43 +000019}
Nico Weber9a1ecf02011-08-22 17:25:57 +000020@end
21
22@interface Subclass2 : NSObject
23- (void)dealloc;
24@end
25
26@implementation Subclass2
27- (void)dealloc {
28 [super dealloc]; // Shouldn't warn
29}
30@end
Ted Kremenek4eb14ca2011-08-22 19:07:43 +000031
32// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s
33// CHECK: warn-missing-super.m:19:1: warning: method possibly missing a [super dealloc] call
34// CHECK: 1 warning generated.
35
36// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-arc %s 2>&1 | FileCheck --check-prefix=CHECK-ARC %s
37// CHECK-ARC: warn-missing-super.m:28:4: error: ARC forbids explicit message send of 'dealloc'
38// CHECK-ARC: 1 error generated.