1 /* Test warnings for shadowing instance variables. */
2 /* Author: Nicola Pero <nicola@brainstorm.co.uk>. */
3 /* { dg-do compile } */
6 @interface MySuperClass
20 @implementation MySuperClass
23 /* FIXME: I wonder if the warnings shouldn't be better generated
24 when the variable is declared, rather than used! */
30 a = private; /* { dg-warning "hides instance variable" } */
31 a = protected; /* { dg-warning "hides instance variable" } */
32 a = public; /* { dg-warning "hides instance variable" } */
37 @interface MyClass : MySuperClass
40 @implementation MyClass
48 /* The private variable can be shadowed without warnings, because
49 * it's invisible, and not accessible, to the subclass! */
51 a = protected; /* { dg-warning "hides instance variable" } */
52 a = public; /* { dg-warning "hides instance variable" } */