• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// 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
3// 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
26// 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
38@implementation Subclass (CAT)
39- (void)dealloc { // expected-warning {{-dealloc is being overridden in a category}}
40}
41@end
42
43// rdar://15919775
44@interface NSObject @end
45@interface NSError:NSObject
46@end
47
48@interface NSError(CAT)
49- (NSError *)MCCopyAsPrimaryError __attribute__((objc_method_family(new)));
50@end
51@implementation NSError(CAT)
52- (NSError *)MCCopyAsPrimaryError {
53  return 0;
54}
55@end
56