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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [objc.dg/] [property/] [at-property-deprecated-2.m] - Rev 704

Compare with Previous | Blame | View Log

/* 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" } */ 
    }
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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