|
3 | 3 |
|
4 | 4 | __attribute__((objc_root_class)) @interface MyObject {
|
5 | 5 | @public
|
6 |
| - id _myMaster; |
| 6 | + id _myLeader; |
7 | 7 | id _isTickledPink; // expected-error {{existing instance variable '_isTickledPink' for property 'isTickledPink'}}
|
8 | 8 | int _myIntProp;
|
9 | 9 | }
|
10 |
| -@property(retain) id myMaster; |
| 10 | +@property(retain) id myLeader; |
11 | 11 | @property(assign) id isTickledPink; // expected-note {{property declared here}}
|
12 | 12 | @property int myIntProp;
|
13 | 13 | @end
|
14 | 14 |
|
15 | 15 | @implementation MyObject
|
16 | 16 |
|
17 |
| -@synthesize myMaster = _myMaster; |
| 17 | +@synthesize myLeader = _myLeader; |
18 | 18 | @synthesize isTickledPink = _isTickledPink; // expected-note {{property synthesized here}}
|
19 | 19 | @synthesize myIntProp = _myIntProp;
|
20 | 20 |
|
21 | 21 | - (void) doSomething {
|
22 |
| - _myMaster = _isTickledPink; // expected-warning {{instance variable '_myMaster' is being directly accessed}} \ |
| 22 | + _myLeader = _isTickledPink; // expected-warning {{instance variable '_myLeader' is being directly accessed}} \ |
23 | 23 | // expected-warning {{instance variable '_isTickledPink' is being directly accessed}}
|
24 | 24 | }
|
25 | 25 |
|
26 | 26 | - (id) init {
|
27 |
| - _myMaster=0; |
28 |
| - return _myMaster; |
| 27 | + _myLeader=0; |
| 28 | + return _myLeader; |
29 | 29 | }
|
30 |
| -- (void) dealloc { _myMaster = 0; } |
| 30 | +- (void) dealloc { _myLeader = 0; } |
31 | 31 | @end
|
32 | 32 |
|
33 | 33 | MyObject * foo ()
|
34 | 34 | {
|
35 | 35 | MyObject* p=0;
|
36 |
| - p.isTickledPink = p.myMaster; // ok |
37 |
| - p->_isTickledPink = (*p)._myMaster; // expected-warning {{instance variable '_isTickledPink' is being directly accessed}} \ |
38 |
| - // expected-warning {{instance variable '_myMaster' is being directly accessed}} |
| 36 | + p.isTickledPink = p.myLeader; // ok |
| 37 | + p->_isTickledPink = (*p)._myLeader; // expected-warning {{instance variable '_isTickledPink' is being directly accessed}} \ |
| 38 | + // expected-warning {{instance variable '_myLeader' is being directly accessed}} |
39 | 39 | if (p->_myIntProp) // expected-warning {{instance variable '_myIntProp' is being directly accessed}}
|
40 | 40 | p->_myIntProp = 0; // expected-warning {{instance variable '_myIntProp' is being directly accessed}}
|
41 | 41 | return p->_isTickledPink; // expected-warning {{instance variable '_isTickledPink' is being directly accessed}}
|
|
0 commit comments