1 /* { dg-do compile } */
3 /* Test deprecate attribute with an @interface declaration. */
6 #include <objc/runtime.h>
8 __attribute__ ((deprecated))
9 @interface DeprecatedClass
17 @implementation DeprecatedClass
18 + (id) classObject { return self; }
19 + (id) new { return nil; }
22 @interface DeprecatedClass (Category)
23 @end /* { dg-warning "is deprecated" } */
25 @interface Subclass : DeprecatedClass
26 @end /* { dg-warning "is deprecated" } */
28 DeprecatedClass *object; /* { dg-warning "is deprecated" } */
30 int function (DeprecatedClass *object) /* { dg-warning "is deprecated" } */
32 /* Note how the following deprecation warning is generated by
33 "DeprecatedClass *", not by "[DeprecatedClass ...]. */
34 DeprecatedClass *x = [DeprecatedClass new]; /* { dg-warning "is deprecated" } */
44 return DeprecatedClass.classObject; /* { dg-warning "is deprecated" } */
47 @interface NormalClass
50 DeprecatedClass *object; /* { dg-warning "is deprecated" } */
52 - (DeprecatedClass *)method; /* { dg-warning "is deprecated" } */
55 @implementation NormalClass
56 - (DeprecatedClass *)method /* { dg-warning "is deprecated" } */