blob: db89b20f5aad5113430c6b3b3e587356bef4862b [file] [log] [blame]
Fariborz Jahanian7e350d22013-12-17 22:44:28 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fsyntax-only -fobjc-arc -fblocks -Wdealloc-in-category -verify %s
2// 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
Fariborz Jahanianb7f03c12012-07-30 20:52:48 +00003// rdar://11987838
4
5@protocol NSObject
6- dealloc; // expected-error {{return type must be correctly specified as 'void' under ARC, instead of 'id'}}
7// CHECK: fix-it:"{{.*}}":{6:3-6:3}:"(void)"
8@end
9
10@protocol Foo <NSObject> @end
11
12@interface Root <Foo>
13@end
14
15@interface Baz : Root {
16}
17@end
18
19@implementation Baz
20- (id) dealloc { // expected-error {{return type must be correctly specified as 'void' under ARC, instead of 'id'}}
21// CHECK: fix-it:"{{.*}}":{20:5-20:7}:"void"
22}
23
24@end
25
Fariborz Jahanian7e350d22013-12-17 22:44:28 +000026// rdar://15397430
27@interface Base
28- (void)dealloc;
29@end
30
31@interface Subclass : Base
32@end
33
34@interface Subclass (CAT)
35- (void)dealloc;
36@end
37
Fariborz Jahanian1b30b592013-12-18 00:52:54 +000038@implementation Subclass (CAT)
Fariborz Jahanian8ef93892013-12-18 16:51:06 +000039- (void)dealloc { // expected-warning {{-dealloc is being overridden in a category}}
Fariborz Jahanian7e350d22013-12-17 22:44:28 +000040}
41@end