1 /* Test errors for accessing @private and @protected variables. */
2 /* Author: Nicola Pero <nicola@brainstorm.co.uk>. */
3 /* { dg-do compile } */
6 @interface MySuperClass
20 @implementation MySuperClass
23 private = 12; /* Ok */
24 protected = 12; /* Ok */
30 @interface MyClass : MySuperClass
33 @implementation MyClass
36 /* Private variables simply don't exist in the subclass. */
37 private = 12; /* { dg-error "instance variable" } */
38 /* { dg-message "function it appears in" "" { target *-*-* } .-1 } */
40 protected = 12; /* Ok */
53 access = m->private; /* { dg-warning "is @private" } */
54 access = m->protected; /* { dg-warning "is @protected" } */
55 access = m->public; /* Ok */