1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 @interface NSObject @end
4 @protocol XCElementP @end
5 @protocol XCElementSpacerP <XCElementP> @end
7 @protocol PWhatever @end
11 - (void)setFlexElement:(NSObject <PWhatever, XCElementP> *)flexer;
12 - (void)setFlexElement2:(NSObject <PWhatever, XCElementSpacerP> *)flexer; // expected-note{{passing argument to parameter 'flexer' here}}
17 NSObject <PWhatever, XCElementSpacerP> * flexer;
18 NSObject <PWhatever, XCElementP> * flexer2;
20 [obj setFlexElement:flexer];
21 // FIXME: GCC provides the following diagnostic (which is much better):
22 // protocol-typecheck.m:21: warning: class 'NSObject <PWhatever, XCElementP>' does not implement the 'XCElementSpacerP' protocol
23 [obj setFlexElement2:flexer2]; // expected-warning{{incompatible pointer types sending 'NSObject<PWhatever,XCElementP> *' to parameter of type 'NSObject<PWhatever,XCElementSpacerP> *'}}