1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
2 /* { dg-do compile } */
4 /* Test dot-syntax with accessors to be looked up in protocols. */
8 #include <objc/runtime.h>
12 - (void) setCountA: (int)aNumber;
17 - (void) setCountB: (int)aNumber;
22 - (void) setCountC: (int)aNumber;
25 @interface MyRootClass
34 @interface MySubClass <ProtocolA, ProtocolB, ProtocolC>
37 int function (MySubClass *object, int x)
41 object.countC = object.countB;
46 int function2 (MyRootClass <ProtocolA, ProtocolB, ProtocolC> *object, int x)
50 object.countC = object.countB;
55 int function3 (MyRootClass <ProtocolA, ProtocolB> *object, int x)
59 object.countC = object.countB; /* { dg-error "request for member .countC. in" } */
61 return object.countC; /* { dg-error "request for member .countC. in" } */
64 int function4 (id <ProtocolA, ProtocolB, ProtocolC> object, int x)
68 object.countC = object.countB;
73 int function5 (id <ProtocolA, ProtocolB> object, int x)
77 object.countC = object.countB; /* { dg-error "request for member .countC. in" } */
79 return object.countC; /* { dg-error "request for member .countC. in" } */