/* Test __attribute__ ((unavailable)) */ /* { dg-do compile } */ /* { dg-options "" } */ #include @interface MyClass { Class isa; } + (int) method; - (int) method; + (int) unavailableClassMethod __attribute__((unavailable)); - (int) unavailableInstanceMethod __attribute__((unavailable)); @end /* Test that unavailability errors are produced, but not if the receiver is of type 'id'. */ void foo (void) { Class c; id object; MyClass *another_object; [c method]; [object method]; [c unavailableClassMethod]; [object unavailableInstanceMethod]; [object method]; [another_object method]; [MyClass unavailableClassMethod]; /* { dg-error "is unavailable" } */ [another_object unavailableInstanceMethod]; /* { dg-error "is unavailable" } */ }