1f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify %s 2f4a2713aSLionel Sambuc 3f4a2713aSLionel Sambuc@interface INTF1 @end 4f4a2713aSLionel Sambuc 5*0a6a1f1dSLionel Sambuc@protocol p1,p2,p3; // expected-note {{protocol 'p2' has no definition}} \ 6*0a6a1f1dSLionel Sambuc // expected-note {{protocol 'p3' has no definition}} 7f4a2713aSLionel Sambuc 8f4a2713aSLionel Sambuc@protocol p1; 9f4a2713aSLionel Sambuc 10f4a2713aSLionel Sambuc@protocol PROTO1 11f4a2713aSLionel Sambuc- (INTF1<p1>*) meth; 12f4a2713aSLionel Sambuc@end 13f4a2713aSLionel Sambuc 14f4a2713aSLionel Sambuc@protocol p1 @end 15f4a2713aSLionel Sambuc 16f4a2713aSLionel Sambuc@interface I1 <p1> @end 17f4a2713aSLionel Sambuc 18f4a2713aSLionel Sambuc@interface E1 <p2> @end // expected-warning {{cannot find protocol definition for 'p2'}} 19f4a2713aSLionel Sambuc 20f4a2713aSLionel Sambuc@protocol p2 @end 21f4a2713aSLionel Sambuc 22f4a2713aSLionel Sambuc 23f4a2713aSLionel Sambuc@interface I2 <p1,p2> @end 24f4a2713aSLionel Sambuc 25f4a2713aSLionel Sambuc@interface E2 <p1,p2,p3> @end // expected-warning {{cannot find protocol definition for 'p3'}} 26f4a2713aSLionel Sambuc 27f4a2713aSLionel Sambuc@class U1, U2; // expected-note {{forward declaration of class here}} 28f4a2713aSLionel Sambuc 29f4a2713aSLionel Sambuc@interface E3 : U1 @end // expected-error {{attempting to use the forward class 'U1' as superclass of 'E3'}} 30f4a2713aSLionel Sambuc 31f4a2713aSLionel Sambuc 32f4a2713aSLionel Sambuc@interface I3 : E3 @end 33f4a2713aSLionel Sambuc 34f4a2713aSLionel Sambuc@interface U2 @end 35f4a2713aSLionel Sambuc 36f4a2713aSLionel Sambuc@interface I4 : U2 <p1,p2> 37f4a2713aSLionel Sambuc@end 38*0a6a1f1dSLionel Sambuc 39*0a6a1f1dSLionel Sambuc// rdar://16111182 40*0a6a1f1dSLionel Sambuc@interface NSObject @end 41*0a6a1f1dSLionel Sambuc 42*0a6a1f1dSLionel Sambuc@protocol UndefinedParentProtocol; // expected-note {{protocol 'UndefinedParentProtocol' has no definition}} 43*0a6a1f1dSLionel Sambuc 44*0a6a1f1dSLionel Sambuc@protocol UndefinedProtocol <UndefinedParentProtocol> 45*0a6a1f1dSLionel Sambuc@end 46*0a6a1f1dSLionel Sambuc 47*0a6a1f1dSLionel Sambuc@interface SomeObject : NSObject <UndefinedProtocol> // expected-warning {{cannot find protocol definition for 'UndefinedProtocol'}} 48*0a6a1f1dSLionel Sambuc@end 49