Debian Codegraph @

clang/test/SemaObjC/provisional-ivar-lookup.m

raw
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2
3 @interface Foo {
4 @private
5 int _foo;
6 int _foo2;
7 }
8 @property (readwrite, nonatomic) int foo, foo1, foo2, foo3;
9 @property (readwrite, nonatomic) int PROP;
10 @end
11
12 @implementation Foo
13
14 @synthesize foo = _foo;
15 @synthesize foo1;
16
17 - (void)setFoo:(int)value {
18 _foo = foo; // expected-error {{use of undeclared identifier 'foo'}}
19 }
20
21 - (void)setFoo1:(int)value {
22 _foo = foo1; // OK
23 }
24
25 - (void)setFoo2:(int)value {
26 _foo = foo2; // expected-error {{use of undeclared identifier 'foo2'}}
27 }
28
29 - (void)setFoo3:(int)value {
30 _foo = foo3; // OK
31 }
32
33 @synthesize foo2 = _foo2;
34 @synthesize foo3;
35
36 @synthesize PROP=PROP;
37 - (void)setPROP:(int)value {
38 PROP = value; // OK
39 }
40
41 @end
42