aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/obj-c++.dg/property/at-property-deprecated-2.mm
blob: d2901a55b5707724d7237caa665126cf26d1e8c0 (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
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010.  */
/* { dg-do compile } */

/* Test that deprecation warnings are produced when a setter/getter of
   a @property is used directly.  */

#include <objc/objc.h>

@interface MyClass
{
  Class isa;
  int variable;
} 
@property (assign, nonatomic) int property __attribute__ ((deprecated));
@end

void foo (void)
{
  MyClass *object = nil;

  if ([object property] > 0)  /* { dg-warning "is deprecated" } */
    {
      [object setProperty: 43]; /* { dg-warning "is deprecated" } */ 
    }
}