blob: 69e355cb9a6f6e5ba9f2aaef6687d06adc47c76e [file] [log] [blame]
Douglas Gregor86f6cf62012-12-11 18:53:07 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify -Wno-objc-root-class %s
Ted Kremenekd61df3d2011-02-14 23:59:16 +00002
3@interface I
Fariborz Jahanianfefe91e2011-07-28 23:19:50 +00004- Meth; // expected-note{{method definition for 'Meth' not found}} \
Ted Kremenek3306ec12012-02-27 22:55:11 +00005 // expected-note{{method 'Meth' declared here}}
Douglas Gregor86f6cf62012-12-11 18:53:07 +00006- unavailableMeth __attribute__((availability(macosx,unavailable)));
7- unavailableMeth2 __attribute__((unavailable));
Ted Kremenekd61df3d2011-02-14 23:59:16 +00008@end
9
10@implementation I // expected-warning{{incomplete implementation}}
11@end
12
13@implementation I(CAT)
Fariborz Jahanianfefe91e2011-07-28 23:19:50 +000014- Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
Ted Kremenekd61df3d2011-02-14 23:59:16 +000015@end
16
17#pragma GCC diagnostic ignored "-Wincomplete-implementation"
18@interface I2
Ted Kremenek3306ec12012-02-27 22:55:11 +000019- Meth; // expected-note{{method 'Meth' declared here}}
Ted Kremenekd61df3d2011-02-14 23:59:16 +000020@end
21
22@implementation I2
23@end
24
25@implementation I2(CAT)
Fariborz Jahanianfefe91e2011-07-28 23:19:50 +000026- Meth {return 0;} // expected-warning {{category is implementing a method which will also be implemented by its primary class}}
Ted Kremenekd61df3d2011-02-14 23:59:16 +000027@end
28
Argyrios Kyrtzidis458bacf2011-10-27 00:09:34 +000029@interface Q
30@end
31
32// rdar://10336158
33@implementation Q
34
35__attribute__((visibility("default")))
Argyrios Kyrtzidisfce79eb2012-03-23 23:24:23 +000036@interface QN // expected-error {{Objective-C declarations may only appear in global scope}}
Argyrios Kyrtzidis458bacf2011-10-27 00:09:34 +000037{
38}
39@end
40
41@end
Ted Kremenekd61df3d2011-02-14 23:59:16 +000042