blob: 54f66efcb22d12327a20afaa484a633ee296b73b [file] [log] [blame]
Patrick Beardb2f68202012-04-06 18:12:22 +00001// RUN: %clang_cc1 -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}}
Ted Kremenekd61df3d2011-02-14 23:59:16 +00006@end
7
8@implementation I // expected-warning{{incomplete implementation}}
9@end
10
11@implementation I(CAT)
Fariborz Jahanianfefe91e2011-07-28 23:19:50 +000012- 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 +000013@end
14
15#pragma GCC diagnostic ignored "-Wincomplete-implementation"
16@interface I2
Ted Kremenek3306ec12012-02-27 22:55:11 +000017- Meth; // expected-note{{method 'Meth' declared here}}
Ted Kremenekd61df3d2011-02-14 23:59:16 +000018@end
19
20@implementation I2
21@end
22
23@implementation I2(CAT)
Fariborz Jahanianfefe91e2011-07-28 23:19:50 +000024- 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 +000025@end
26
Argyrios Kyrtzidis458bacf2011-10-27 00:09:34 +000027@interface Q
28@end
29
30// rdar://10336158
31@implementation Q
32
33__attribute__((visibility("default")))
Argyrios Kyrtzidisfce79eb2012-03-23 23:24:23 +000034@interface QN // expected-error {{Objective-C declarations may only appear in global scope}}
Argyrios Kyrtzidis458bacf2011-10-27 00:09:34 +000035{
36}
37@end
38
39@end
Ted Kremenekd61df3d2011-02-14 23:59:16 +000040