diff options
Diffstat (limited to 'gcc/testsuite/objc.dg/attributes/class-attribute-2.m')
-rw-r--r-- | gcc/testsuite/objc.dg/attributes/class-attribute-2.m | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/gcc/testsuite/objc.dg/attributes/class-attribute-2.m b/gcc/testsuite/objc.dg/attributes/class-attribute-2.m index 3ab93cc..2e1bacb 100644 --- a/gcc/testsuite/objc.dg/attributes/class-attribute-2.m +++ b/gcc/testsuite/objc.dg/attributes/class-attribute-2.m @@ -1,25 +1,21 @@ /* { dg-do compile } */ #include <objc/objc.h> -#include "../../objc-obj-c++-shared/Object1.h" -__attribute ((deprecated)) -@interface depobj : Object { /* { dg-warning "class attributes are not available in this version" } */ -@public - int ivar; -} -- (int) mth; +__attribute__ ((deprecated)) +@interface DeprecatedClass +{ + Class isa; +} ++ (id) new; @end -__attribute ((deprecated)) -@implementation depobj /* { dg-warning "prefix attributes are ignored for implementations" } */ --(int) mth { return ivar; } +__attribute__ ((deprecated)) +@implementation DeprecatedClass /* { dg-warning "prefix attributes are ignored for implementations" } */ ++ (id) new { return nil; } @end -int foo (void) +void function (void) { - depobj *p = [depobj new]; /* dg - warning "deprecated" */ - - int q = p->ivar; - return [p mth]; + DeprecatedClass *object = [DeprecatedClass new]; /* { dg-warning "is deprecated" } */ } |