1 /* Test assignments and comparisons involving category protocols. */
2 /* Author: Nicola Pero <nicola@brainstorm.co.uk>. */
3 /* { dg-do compile } */
14 @interface MyClass (Addition) <MyProtocol>
18 @interface MyOtherClass : MyClass
23 id <MyProtocol> obj_p = nil;
24 MyClass *obj_cp = nil;
25 MyOtherClass *obj_cp2 = nil;
27 obj_cp = obj_p; /* { dg-warning "distinct Objective\\-C type" } */
28 obj_cp2 = obj_p; /* { dg-warning "distinct Objective\\-C type" } */
29 obj_p = obj_cp; /* Ok */
30 obj_p = obj_cp2; /* Ok */
32 if (obj_cp == obj_p) ; /* Ok */
33 if (obj_cp2 == obj_p) ; /* Ok */
34 if (obj_p == obj_cp) ; /* Ok */
35 if (obj_p == obj_cp2) ; /* Ok */