2013-12-18 06:44:28 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -Wdealloc-in-category -verify %s
|
|
|
|
// RUN: not %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -Wdealloc-in-category -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
|
2012-07-31 04:52:48 +08:00
|
|
|
// rdar://11987838
|
|
|
|
|
|
|
|
@protocol NSObject
|
|
|
|
- dealloc; // expected-error {{return type must be correctly specified as 'void' under ARC, instead of 'id'}}
|
|
|
|
// CHECK: fix-it:"{{.*}}":{6:3-6:3}:"(void)"
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol Foo <NSObject> @end
|
|
|
|
|
|
|
|
@interface Root <Foo>
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Baz : Root {
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation Baz
|
|
|
|
- (id) dealloc { // expected-error {{return type must be correctly specified as 'void' under ARC, instead of 'id'}}
|
|
|
|
// CHECK: fix-it:"{{.*}}":{20:5-20:7}:"void"
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2013-12-18 06:44:28 +08:00
|
|
|
// rdar://15397430
|
|
|
|
@interface Base
|
|
|
|
- (void)dealloc;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Subclass : Base
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface Subclass (CAT)
|
|
|
|
- (void)dealloc;
|
|
|
|
@end
|
|
|
|
|
2013-12-18 08:52:54 +08:00
|
|
|
@implementation Subclass (CAT)
|
2013-12-19 00:51:06 +08:00
|
|
|
- (void)dealloc { // expected-warning {{-dealloc is being overridden in a category}}
|
2013-12-18 06:44:28 +08:00
|
|
|
}
|
|
|
|
@end
|