Douglas Gregor | 86f6cf6 | 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 | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 2 | |
| 3 | @interface I |
Fariborz Jahanian | fefe91e | 2011-07-28 23:19:50 +0000 | [diff] [blame] | 4 | - Meth; // expected-note{{method definition for 'Meth' not found}} \ |
Ted Kremenek | 3306ec1 | 2012-02-27 22:55:11 +0000 | [diff] [blame] | 5 | // expected-note{{method 'Meth' declared here}} |
Douglas Gregor | 86f6cf6 | 2012-12-11 18:53:07 +0000 | [diff] [blame] | 6 | - unavailableMeth __attribute__((availability(macosx,unavailable))); |
| 7 | - unavailableMeth2 __attribute__((unavailable)); |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 8 | @end |
| 9 | |
| 10 | @implementation I // expected-warning{{incomplete implementation}} |
| 11 | @end |
| 12 | |
| 13 | @implementation I(CAT) |
Fariborz Jahanian | fefe91e | 2011-07-28 23:19:50 +0000 | [diff] [blame] | 14 | - Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 15 | @end |
| 16 | |
| 17 | #pragma GCC diagnostic ignored "-Wincomplete-implementation" |
| 18 | @interface I2 |
Ted Kremenek | 3306ec1 | 2012-02-27 22:55:11 +0000 | [diff] [blame] | 19 | - Meth; // expected-note{{method 'Meth' declared here}} |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 20 | @end |
| 21 | |
| 22 | @implementation I2 |
| 23 | @end |
| 24 | |
| 25 | @implementation I2(CAT) |
Fariborz Jahanian | fefe91e | 2011-07-28 23:19:50 +0000 | [diff] [blame] | 26 | - Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}} |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 27 | @end |
| 28 | |
Argyrios Kyrtzidis | 458bacf | 2011-10-27 00:09:34 +0000 | [diff] [blame] | 29 | @interface Q |
| 30 | @end |
| 31 | |
| 32 | // rdar://10336158 |
| 33 | @implementation Q |
| 34 | |
| 35 | __attribute__((visibility("default"))) |
Argyrios Kyrtzidis | fce79eb | 2012-03-23 23:24:23 +0000 | [diff] [blame] | 36 | @interface QN // expected-error {{Objective-C declarations may only appear in global scope}} |
Argyrios Kyrtzidis | 458bacf | 2011-10-27 00:09:34 +0000 | [diff] [blame] | 37 | { |
| 38 | } |
| 39 | @end |
| 40 | |
| 41 | @end |
Ted Kremenek | d61df3d | 2011-02-14 23:59:16 +0000 | [diff] [blame] | 42 | |