Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 @interface NSObject @end
      4 @protocol XCElementP @end
      5 @protocol XCElementSpacerP <XCElementP>  @end
      6 
      7 @protocol PWhatever @end
      8 
      9 @interface XX
     10 
     11 - (void)setFlexElement:(NSObject <PWhatever, XCElementP> *)flexer;
     12 - (void)setFlexElement2:(NSObject <PWhatever, XCElementSpacerP> *)flexer; // expected-note{{passing argument to parameter 'flexer' here}}
     13 
     14 @end
     15 
     16 void func() {
     17   NSObject <PWhatever, XCElementSpacerP> * flexer;
     18   NSObject <PWhatever, XCElementP> * flexer2;
     19   XX *obj;
     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> *'}}
     24 }
     25 
     26