OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [property/] [at-property-deprecated-1.mm] - Blame information for rev 703

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Contributed by Nicola Pero , October 2010.  */
2
/* { dg-do compile } */
3
 
4
/* Test that properties can be deprecated.  */
5
 
6
#include 
7
#include 
8
#include 
9
 
10
@interface MyRootClass
11
{
12
  Class isa;
13
  int a;
14
}
15
@property int a __attribute__((deprecated));
16
+ (id) initialize;
17
+ (id) alloc;
18
- (id) init;
19
@end
20
 
21
@implementation MyRootClass
22
+ (id) initialize { return self; }
23
+ (id) alloc { return class_createInstance (self, 0); }
24
- (id) init { return self; }
25
@synthesize a;
26
@end
27
 
28
int main (void)
29
{
30
  MyRootClass *object = [[MyRootClass alloc] init];
31
 
32
  object.a = 40;      /* { dg-warning "is deprecated" } */
33
  if (object.a != 40) /* { dg-warning "is deprecated" } */
34
    abort ();
35
 
36
  return (0);
37
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.