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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [obj-c++.dg/] [property/] [dynamic-4.mm] - Blame information for rev 820

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 703 jeremybenn
/* Contributed by Nicola Pero , November 2010.  */
2
/* { dg-do compile } */
3
 
4
#include 
5
 
6
@interface MyRootClass
7
{
8
  Class isa;
9
}
10
@end
11
 
12
@implementation MyRootClass
13
@end
14
 
15
/* Test @property/@dynamic with protocols.  */
16
 
17
@protocol MyProtocol
18
@property int a;
19
@end
20
 
21
 
22
/* This class is declared to conform to the protocol, but because of
23
   @dynamic, no warnings are issued even if the getter/setter for the
24
   @property are missing.  */
25
@interface MyClass1 : MyRootClass 
26
@end
27
 
28
@implementation MyClass1
29
@dynamic a;
30
@end
31
 
32
 
33
/* This class is declared to conform to the protocol and warnings are
34
   issued because the setter for the @property is missing.  */
35
@interface MyClass2 : MyRootClass 
36
@end
37
 
38
@implementation MyClass2
39
- (int) a
40
{
41
  return 0;
42
}
43
@end /* { dg-warning "incomplete implementation" } */
44
/* { dg-warning "method definition for .-setA:. not found" "" { target *-*-* } 43 } */
45
/* { dg-warning "class .MyClass2. does not fully implement the .MyProtocol. protocol" "" { target *-*-* } 43 } */

powered by: WebSVN 2.1.0

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