1 /* Test instance variable scope. */
2 /* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
3 /* { dg-do compile } */
4 /* { dg-additional-options "-fno-local-ivars" } */
7 #if defined(__has_attribute) && __has_attribute(objc_root_class)
8 __attribute__((objc_root_class))
15 - (void) testshadowing;
18 @implementation MyClass
23 a = self->someivar; /* No warning or error. */
24 a = someivar; /* { dg-error ".someivar. undeclared" } */
27 - (void) testshadowing
32 /* Since instance variables don't have local scope no shadowing
35 a = someivar; /* No warning. */