aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/attributes/class-attribute-2.m
blob: 3ab93ccdfc2ec33a08c3d7e88dac128717a7fb60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* { 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;
@end

__attribute ((deprecated)) 
@implementation depobj /* { dg-warning "prefix attributes are ignored for implementations" } */
-(int) mth {  return ivar; } 
@end

int foo (void)
{
    depobj *p = [depobj new];	/*  dg - warning "deprecated"   */ 

    int q = p->ivar;
    return [p mth];    
}