Home | History | Annotate | Download | only in SemaObjC
      1 // RUN: %clang_cc1 -pedantic -fsyntax-only -verify %s
      2 
      3 @protocol MyProto1 
      4 @end
      5 
      6 @protocol MyProto2 
      7 @end
      8 
      9 @interface INTF @end
     10 
     11 INTF <MyProto1> * Func(INTF <MyProto1, MyProto2> *p2) // expected-note{{passing argument to parameter 'p2' here}}
     12 {
     13 	return p2;
     14 }
     15 
     16 
     17 INTF <MyProto1> * Func1(INTF <MyProto1, MyProto2> *p2)
     18 {
     19 	return p2;
     20 }
     21 
     22 INTF <MyProto1, MyProto2> * Func2(INTF <MyProto1> *p2)
     23 {
     24 	Func(p2);	// expected-warning {{incompatible pointer types passing 'INTF<MyProto1> *' to parameter of type 'INTF<MyProto1,MyProto2> *'}}
     25 	return p2;	// expected-warning {{incompatible pointer types returning 'INTF<MyProto1> *' from a function with result type 'INTF<MyProto1,MyProto2> *'}}
     26 }
     27 
     28 
     29 
     30 INTF <MyProto1> * Func3(INTF <MyProto2> *p2)
     31 {
     32 	return p2;	// expected-warning {{incompatible pointer types returning 'INTF<MyProto2> *' from a function with result type 'INTF<MyProto1> *'}}
     33 }
     34 
     35 
     36 INTF <MyProto1, MyProto2> * Func4(INTF <MyProto2, MyProto1> *p2)
     37 {
     38 	return p2;
     39 }
     40 
     41