1 /* { dg-do compile } */
2 /* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
4 /* Test deprecate attribute with an @interface declaration. */
7 #include <objc/runtime.h>
9 __attribute__ ((deprecated))
10 @interface DeprecatedClass
18 @implementation DeprecatedClass
19 + (id) classObject { return self; }
20 + (id) new { return nil; }
23 @interface DeprecatedClass (Category) /* { dg-warning "is deprecated" } */
26 @interface Subclass : DeprecatedClass /* { dg-warning "is deprecated" } */
29 DeprecatedClass *object; /* { dg-warning "is deprecated" } */
31 int function (DeprecatedClass *object) /* { dg-warning "is deprecated" } */
33 /* Note how the following deprecation warning is generated by
34 "DeprecatedClass *", not by "[DeprecatedClass ...]. */
35 DeprecatedClass *x = [DeprecatedClass new]; /* { dg-warning "is deprecated" } */
45 return DeprecatedClass.classObject; /* { dg-warning "is deprecated" } */
48 @interface NormalClass
51 DeprecatedClass *object; /* { dg-warning "is deprecated" } */
53 - (DeprecatedClass *)method; /* { dg-warning "is deprecated" } */
56 @implementation NormalClass
57 - (DeprecatedClass *)method /* { dg-warning "is deprecated" } */