1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 @interface Sprite { // expected-note{{'Sprite' declared here}}
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 {{unknown type name 'Xsprite'; did you mean 'Sprite'?}} \
21 // expected-error{{expected identifier or '('}}
24 + (void)setSprite:(int)sprite {
28 ((Sprite *)self)->sprite = 16; /* NB: This is how one _should_ access */
29 ((Sprite *)self)->spree = 18; /* ivars from within class methods! */
31 - (void)setFoo:(int)foo {
35 - (void)setSprite:(int)sprite {
37 sprite = 15; // expected-warning {{local declaration of 'sprite' hides instance variable}}
39 spree = 17; // expected-warning {{local declaration of 'spree' hides instance variable}}