66 lines · plain
1// RUN: %clang_cc1 -fsyntax-only -Wno-deprecated-declarations -verify %s2 3@interface INTF14@required // expected-error {{directive may only be specified in protocols only}}5- (int) FooBar;6- (int) FooBar1;7- (int) FooBar2;8@optional // expected-error {{directive may only be specified in protocols only}}9+ (int) C;10 11- (int)I;12@end13 14@protocol p1,p2,p3;15 16@protocol p1;17 18@protocol PROTO119@required 20- (int) FooBar;21@optional22- (void) MyMethod1;23+ (int) S;24@end25 26 27@protocol PROTO2<p1>28@end29 30@protocol p1 @end31 32@protocol PROTO<p1> // expected-note {{previous definition is here}}33@end34 35@protocol PROTO<p1> // expected-warning {{duplicate protocol definition of 'PROTO'}}36@end37 38@protocol PROTO3<p1, p1>39@end40 41@protocol p2 <p1>42@end43 44@protocol PROTO4 <p1, p2, PROTO, PROTO3, p3> 45@end46 47@protocol XX;48@protocol YY <XX> // Use of declaration of XX here should not cause a warning.49- zz;50@end51 52 53// Detect circular dependencies.54@protocol B;55@protocol C < B > // expected-note{{previous definition is here}}56@end57@protocol A < C > 58@end59@protocol B < A > // expected-error{{protocol has circular dependency}}60@end61 62@protocol P63- (int)test:(int)param, ..; // expected-error{{type specifier missing}} \64 // expected-error{{expected ';' after method prototype}}65@end66