2011-08-23 01:25:57 +08:00
|
|
|
@protocol NSCopying @end
|
|
|
|
|
2012-04-07 02:12:22 +08:00
|
|
|
__attribute__((objc_root_class))
|
2011-08-23 01:25:57 +08:00
|
|
|
@interface NSObject <NSCopying>
|
|
|
|
- (void)dealloc;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation NSObject
|
|
|
|
- (void)dealloc {
|
|
|
|
// Root class, shouldn't warn
|
|
|
|
}
|
2011-08-29 06:35:17 +08:00
|
|
|
- (void)finalize {
|
|
|
|
// Root class, shouldn't warn
|
|
|
|
}
|
2011-08-23 01:25:57 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Subclass1 : NSObject
|
|
|
|
- (void)dealloc;
|
2011-08-29 06:35:17 +08:00
|
|
|
- (void)finalize;
|
2011-08-23 01:25:57 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Subclass1
|
|
|
|
- (void)dealloc {
|
2011-08-23 03:07:43 +08:00
|
|
|
}
|
2011-08-29 06:35:17 +08:00
|
|
|
- (void)finalize {
|
|
|
|
}
|
2011-08-23 01:25:57 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Subclass2 : NSObject
|
|
|
|
- (void)dealloc;
|
2011-08-29 06:35:17 +08:00
|
|
|
- (void)finalize;
|
2011-08-23 01:25:57 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Subclass2
|
|
|
|
- (void)dealloc {
|
|
|
|
[super dealloc]; // Shouldn't warn
|
|
|
|
}
|
2011-08-29 06:35:17 +08:00
|
|
|
- (void)finalize {
|
|
|
|
[super finalize]; // Shouldn't warn
|
|
|
|
}
|
2011-08-23 01:25:57 +08:00
|
|
|
@end
|
2011-08-23 03:07:43 +08:00
|
|
|
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s
|
2012-09-11 00:51:09 +08:00
|
|
|
// CHECK: warn-missing-super.m:24:1: warning: method possibly missing a [super dealloc] call
|
2011-09-29 03:32:29 +08:00
|
|
|
// CHECK: 1 warning generated.
|
|
|
|
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -fobjc-gc %s 2>&1 | FileCheck --check-prefix=CHECK-GC %s
|
2012-09-11 00:51:09 +08:00
|
|
|
// CHECK-GC: warn-missing-super.m:24:1: warning: method possibly missing a [super dealloc] call
|
2012-04-07 02:12:22 +08:00
|
|
|
// CHECK-GC: warn-missing-super.m:26:1: warning: method possibly missing a [super finalize] call
|
2011-09-29 03:32:29 +08:00
|
|
|
// CHECK-GC: 2 warnings generated.
|
|
|
|
|
|
|
|
// RUN: %clang_cc1 -fsyntax-only -fobjc-gc-only %s 2>&1 | FileCheck --check-prefix=CHECK-GC-ONLY %s
|
2012-04-07 02:12:22 +08:00
|
|
|
// CHECK-GC-ONLY: warn-missing-super.m:26:1: warning: method possibly missing a [super finalize] call
|
2011-09-29 03:32:29 +08:00
|
|
|
// CHECK-GC-ONLY: 1 warning generated.
|
2011-08-23 03:07:43 +08:00
|
|
|
|
2011-10-02 09:16:38 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-arc %s 2>&1 | FileCheck --check-prefix=CHECK-ARC %s
|
2012-04-07 02:12:22 +08:00
|
|
|
// CHECK-ARC: warn-missing-super.m:36:4: error: ARC forbids explicit message send of 'dealloc'
|
2011-08-30 06:59:14 +08:00
|
|
|
// CHECK-ARC: 1 error generated.
|