Daily bump.
[official-gcc.git] / gcc / testsuite / objc.dg / attributes / method-unavailable-2.m
blob68ea46d254309cdecff081daa9357a74e6d3f5ff
1 /* Test __attribute__ ((unavailable)) */
2 /* { dg-do compile } */
3 /* { dg-options "" } */
5 #include <objc/objc.h>
7 @interface MyClass
9   Class isa;
11 + (int) unavailableClassMethod: (id)firstObject, ...    __attribute__((sentinel)) __attribute__((unavailable));
12 - (int) unavailableInstanceMethod: (id)firstobject, ... __attribute__((sentinel)) __attribute__((unavailable));
13 @end
15 /* Test that unavailability errors 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)
20   MyClass *object = nil;
22   [MyClass unavailableClassMethod: object, nil];           /* { dg-error "is unavailable" } */
23   [object unavailableInstanceMethod: object, nil];         /* { dg-error "is unavailable" } */