Debian Codegraph @

gcc/testsuite/objc.dg/attributes/method-deprecated-2.m

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 @interface MyClass
8 {
9 Class isa;
10 }
11 + (int) deprecatedClassMethod: (id)firstObject, ... __attribute__((sentinel)) __attribute__((deprecated));
12 - (int) deprecatedInstanceMethod: (id)firstobject, ... __attribute__((sentinel)) __attribute__((deprecated));
13 @end
14
15 /* Test that deprecation warnings are produced even if the method is
16 also marked with another attribute too (this is to test the
17 processing of multiple attributes). */
18 void foo (void)
19 {
20 MyClass *object = nil;
21
22 [MyClass deprecatedClassMethod: object, nil]; /* { dg-warning "is deprecated" } */
23 [object deprecatedInstanceMethod: object, nil]; /* { dg-warning "is deprecated" } */
24 }