1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
7 + (void)setFoo:(int)foo;
8 + (void)setSprite:(int)sprite;
9 - (void)setFoo:(int)foo;
10 - (void)setSprite:(int)sprite;
16 @implementation Sprite
17 + (void)setFoo:(int)foo {
18 sprite = foo; // expected-error {{instance variable 'sprite' accessed in class method}}
20 Xsprite = foo; // expected-error {{use of undeclared identifier 'Xsprite'}}
23 + (void)setSprite:(int)sprite {
27 ((Sprite *)self)->sprite = 16; /* NB: This is how one _should_ access */
28 ((Sprite *)self)->spree = 18; /* ivars from within class methods! */
30 - (void)setFoo:(int)foo {
34 - (void)setSprite:(int)sprite {
36 sprite = 15; // expected-warning {{local declaration of 'sprite' hides instance variable}}
38 spree = 17; // expected-warning {{local declaration of 'spree' hides instance variable}}