xref: /llvm-project/clang/test/SemaObjC/incomplete-implementation.m (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s
2
3@interface I
4- Meth; // expected-note 2 {{method 'Meth' declared here}}
5- unavailableMeth __attribute__((availability(macosx,unavailable)));
6- unavailableMeth2 __attribute__((unavailable));
7@end
8
9@implementation  I  // expected-warning {{method definition for 'Meth' not found}}
10@end
11
12@implementation I(CAT)
13- Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
14@end
15
16@interface MyClass
17-(void)mymeth __attribute__((availability(macos, introduced=100))); // expected-note{{here}}
18@end
19@implementation MyClass // expected-warning{{'mymeth' not found}}
20@end
21
22#pragma GCC diagnostic ignored "-Wincomplete-implementation"
23@interface I2
24- Meth; // expected-note{{method 'Meth' declared here}}
25@end
26
27@implementation  I2
28@end
29
30@implementation I2(CAT)
31- Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
32@end
33
34@interface Q
35@end
36
37@implementation Q
38
39__attribute__((visibility("default")))
40@interface QN // expected-error {{Objective-C declarations may only appear in global scope}}
41{
42}
43@end
44
45@end
46
47typedef char BOOL;
48
49@protocol NSObject
50- (BOOL)isEqual:(id)object;
51@end
52
53@interface NSObject <NSObject>
54@end
55
56@protocol NSApplicationDelegate <NSObject>
57- (void)ImpleThisMethod; // expected-note {{method 'ImpleThisMethod' declared here}}
58@end
59
60@interface AppDelegate : NSObject <NSApplicationDelegate>
61@end
62
63@implementation AppDelegate (MRRCategory)
64
65- (BOOL)isEqual:(id)object
66{
67    return __objc_no;
68}
69
70- (void)ImpleThisMethod {} // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
71@end
72