Debian Codegraph @

gcc/testsuite/obj-c++.dg/attributes/method-deprecated-3.mm

raw
1 /* Contributed by Nicola Pero <[email protected]>, October 2010. */
2 /* { dg-do compile } */
3 /* { dg-additional-options "-Wno-objc-root-class" } */
4
5 #include <objc/objc.h>
6
7 /* Test that __attribute__ ((__deprecated__)) works as well as __attribute__ ((deprecated)). */
8 @interface MyClass
9 {
10 Class isa;
11 }
12 + (int) deprecatedClassMethod: (id)firstObject, ... __attribute__((__deprecated__));
13 - (int) deprecatedInstanceMethod: (id)firstobject, ... __attribute__((__deprecated__));
14 @end
15
16 void foo (void)
17 {
18 MyClass *object = nil;
19
20 [MyClass deprecatedClassMethod: object, nil]; /* { dg-warning "is deprecated" } */
21 [object deprecatedInstanceMethod: object, nil]; /* { dg-warning "is deprecated" } */
22 }