URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [property/] [dynamic-3.mm] - Rev 717
Go to most recent revision | Compare with Previous | Blame | View Log
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
#include <objc/objc.h>
@interface MyRootClass
{
Class isa;
}
@end
@implementation MyRootClass
@end
/* Test @property/@dynamic in a category. First, a case where
@dynamic should turn off all warnings. */
@interface MyRootClass (Category)
@property int a;
- (int) test;
@end
@implementation MyRootClass (Category)
@dynamic a;
- (int) test
{
return self.a; /* This should compile into [self a] with no warnings. */
}
@end
/* Test @property/@dynamic in a category. Second, a case with a
missing setter and no @dynamic. A warning should be generated. */
@interface MyRootClass (Category2)
@property int b;
- (int) test;
@end
@implementation MyRootClass (Category2)
- (int) b
{
return 0;
}
- (int) test
{
return self.b;
}
@end /* { dg-warning "incomplete implementation" } */
/* { dg-warning "method definition for .-setB:. not found" "" { target *-*-* } 48 } */
Go to most recent revision | Compare with Previous | Blame | View Log