| 1 |
/* Contributed by Nicola Pero <[email protected]>, October 2010. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
|
| 4 |
/* Test the 'dot syntax' with deprecated methods. */ |
| 5 |
|
| 6 |
#include <objc/objc.h> |
| 7 |
|
| 8 |
@interface MyClass |
| 9 |
{ |
| 10 |
Class isa; |
| 11 |
} |
| 12 |
+ (int) classCount __attribute__ ((deprecated)); |
| 13 |
+ (void) setClassCount: (int)value __attribute__ ((deprecated)); |
| 14 |
|
| 15 |
- (int) count __attribute__ ((deprecated)); |
| 16 |
- (void) setCount: (int)value __attribute__ ((deprecated)); |
| 17 |
|
| 18 |
- (int) classCount2; |
| 19 |
- (void) setClassCount2: (int)value; |
| 20 |
|
| 21 |
- (int) count2; |
| 22 |
- (void) setCount2: (int)value; |
| 23 |
@end |
| 24 |
|
| 25 |
void foo (void) |
| 26 |
{ |
| 27 |
MyClass *object = nil; |
| 28 |
|
| 29 |
|
| 30 |
if (object.count > 0) /* { dg-warning "is deprecated" } */ |
| 31 |
object.count = 20; /* { dg-warning "is deprecated" } */ |
| 32 |
|
| 33 |
if (MyClass.classCount < -7) /* { dg-warning "is deprecated" } */ |
| 34 |
MyClass.classCount = 11; /* { dg-warning "is deprecated" } */ |
| 35 |
|
| 36 |
if (object.classCount2 > 0) |
| 37 |
object.classCount2 = 19; |
| 38 |
|
| 39 |
if (object.count2 < -7) |
| 40 |
object.count2 = 74; |
| 41 |
} |