Douglas Gregor | c2e3d5c | 2012-12-11 18:53:07 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s |
Ted Kremenek | 05e63e0 | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 2 | |
| 3 | @interface I |
Ted Kremenek | 65d6357 | 2013-03-27 00:02:21 +0000 | [diff] [blame] | 4 | - Meth; // expected-note 2 {{method 'Meth' declared here}} |
Douglas Gregor | c2e3d5c | 2012-12-11 18:53:07 +0000 | [diff] [blame] | 5 | - unavailableMeth __attribute__((availability(macosx,unavailable))); |
| 6 | - unavailableMeth2 __attribute__((unavailable)); |
Ted Kremenek | 05e63e0 | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 7 | @end |
| 8 | |
Ted Kremenek | 65d6357 | 2013-03-27 00:02:21 +0000 | [diff] [blame] | 9 | @implementation I // expected-warning {{method definition for 'Meth' not found}} |
Ted Kremenek | 05e63e0 | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 10 | @end |
| 11 | |
| 12 | @implementation I(CAT) |
Fariborz Jahanian | 9f8b19e | 2011-07-28 23:19:50 +0000 | [diff] [blame] | 13 | - Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} |
Ted Kremenek | 05e63e0 | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 14 | @end |
| 15 | |
Erik Pilkington | ecce5c9 | 2018-07-07 01:50:20 +0000 | [diff] [blame] | 16 | // rdar://40634455 |
| 17 | @interface MyClass |
| 18 | -(void)mymeth __attribute__((availability(macos, introduced=100))); // expected-note{{here}} |
| 19 | @end |
| 20 | @implementation MyClass // expected-warning{{'mymeth' not found}} |
| 21 | @end |
| 22 | |
Ted Kremenek | 05e63e0 | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 23 | #pragma GCC diagnostic ignored "-Wincomplete-implementation" |
| 24 | @interface I2 |
Ted Kremenek | 59b10db | 2012-02-27 22:55:11 +0000 | [diff] [blame] | 25 | - Meth; // expected-note{{method 'Meth' declared here}} |
Ted Kremenek | 05e63e0 | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 26 | @end |
| 27 | |
| 28 | @implementation I2 |
| 29 | @end |
| 30 | |
| 31 | @implementation I2(CAT) |
Fariborz Jahanian | 9f8b19e | 2011-07-28 23:19:50 +0000 | [diff] [blame] | 32 | - Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} |
Ted Kremenek | 05e63e0 | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 33 | @end |
| 34 | |
Argyrios Kyrtzidis | a9aabf7 | 2011-10-27 00:09:34 +0000 | [diff] [blame] | 35 | @interface Q |
| 36 | @end |
| 37 | |
| 38 | // rdar://10336158 |
| 39 | @implementation Q |
| 40 | |
| 41 | __attribute__((visibility("default"))) |
Argyrios Kyrtzidis | 822c433 | 2012-03-23 23:24:23 +0000 | [diff] [blame] | 42 | @interface QN // expected-error {{Objective-C declarations may only appear in global scope}} |
Argyrios Kyrtzidis | a9aabf7 | 2011-10-27 00:09:34 +0000 | [diff] [blame] | 43 | { |
| 44 | } |
| 45 | @end |
| 46 | |
| 47 | @end |
Ted Kremenek | 05e63e0 | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 48 | |
Fariborz Jahanian | f3077a2 | 2013-12-05 20:52:31 +0000 | [diff] [blame] | 49 | // rdar://15580969 |
| 50 | typedef char BOOL; |
| 51 | |
| 52 | @protocol NSObject |
| 53 | - (BOOL)isEqual:(id)object; |
| 54 | @end |
| 55 | |
| 56 | @interface NSObject <NSObject> |
| 57 | @end |
| 58 | |
| 59 | @protocol NSApplicationDelegate <NSObject> |
| 60 | - (void)ImpleThisMethod; // expected-note {{method 'ImpleThisMethod' declared here}} |
| 61 | @end |
| 62 | |
| 63 | @interface AppDelegate : NSObject <NSApplicationDelegate> |
| 64 | @end |
| 65 | |
| 66 | @implementation AppDelegate (MRRCategory) |
| 67 | |
| 68 | - (BOOL)isEqual:(id)object |
| 69 | { |
| 70 | return __objc_no; |
| 71 | } |
| 72 | |
| 73 | - (void)ImpleThisMethod {} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} |
| 74 | @end |