| 1 |
// RUN: %clang_cc1 -Wno-objc-root-class -verify %s |
| 2 |
|
| 3 |
@interface I |
| 4 |
- (void) setP : (int)arg; |
| 5 |
@end |
| 6 |
|
| 7 |
@interface J |
| 8 |
- (int) P; |
| 9 |
@end |
| 10 |
|
| 11 |
@interface K @end |
| 12 |
|
| 13 |
@interface II @end |
| 14 |
|
| 15 |
@implementation II |
| 16 |
- (void) Meth : (I*) arg { |
| 17 |
arg.P++; // expected-error {{no getter method 'P' for increment of property}} |
| 18 |
--arg.P; // expected-error {{no getter method 'P' for decrement of property}} |
| 19 |
} |
| 20 |
- (void) Meth1 : (J*) arg { |
| 21 |
arg.P++; // expected-error {{no setter method 'setP:' for increment of property}} |
| 22 |
arg.P--; // expected-error {{no setter method 'setP:' for decrement of property}} |
| 23 |
} |
| 24 |
|
| 25 |
- (void) Meth2 : (K*) arg { |
| 26 |
arg.P++; // expected-error {{property 'P' not found on object of type 'K *'}} |
| 27 |
arg.P--; // expected-error {{property 'P' not found on object of type 'K *'}} |
| 28 |
} |
| 29 |
@end |