Improve the diagnostic for -Wcustom-atomic-properties. Suggestion by Fariborz!
[clang.git] / test / SemaObjC / incompatible-protocol-qualified-types.m
blob494d23e8b267890842841d31cf3618dbc0eb4c9a
1 // RUN: %clang_cc1 -pedantic -fsyntax-only -verify %s
3 @protocol MyProto1 
4 @end
6 @protocol MyProto2 
7 @end
9 @interface INTF @end
11 INTF <MyProto1> * Func(INTF <MyProto1, MyProto2> *p2) // expected-note{{passing argument to parameter 'p2' here}}
13         return p2;
17 INTF <MyProto1> * Func1(INTF <MyProto1, MyProto2> *p2)
19         return p2;
22 INTF <MyProto1, MyProto2> * Func2(INTF <MyProto1> *p2)
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> *'}}
30 INTF <MyProto1> * Func3(INTF <MyProto2> *p2)
32         return p2;      // expected-warning {{incompatible pointer types returning 'INTF<MyProto2> *' from a function with result type 'INTF<MyProto1> *'}}
36 INTF <MyProto1, MyProto2> * Func4(INTF <MyProto2, MyProto1> *p2)
38         return p2;