PR target/84336
[official-gcc.git] / gcc / testsuite / objc.dg / attributes / method-deprecated-2.m
blob1e5d87f3e632a08aab67aa8eabd0b2091e1a2b99
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010.  */
2 /* { dg-do compile } */
4 #include <objc/objc.h>
6 @interface MyClass
8   Class isa;
9
10 + (int) deprecatedClassMethod: (id)firstObject, ...    __attribute__((sentinel)) __attribute__((deprecated));
11 - (int) deprecatedInstanceMethod: (id)firstobject, ... __attribute__((sentinel)) __attribute__((deprecated));
12 @end
14 /* Test that deprecation warnings are produced even if the method is
15    also marked with another attribute too (this is to test the
16    processing of multiple attributes).  */
17 void foo (void)
19   MyClass *object = nil;
21   [MyClass deprecatedClassMethod: object, nil];           /* { dg-warning "is deprecated" } */
22   [object deprecatedInstanceMethod: object, nil];         /* { dg-warning "is deprecated" } */