Introduce ObjCMessageExpr::getReceiverRange() to get the source range of the receiver.
[clang.git] / test / CodeGenObjC / default-property-synthesis.m
blobb3eeb22004aeb9f1fea3db07b1c4cedeee582854
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi2 -emit-llvm -o %t %s
2 // rdar://7923851.
4 // Superclass declares property. Subclass redeclares the same property.
5 // Do not @synthesize-by-default in the subclass. P1
6 // Superclass declares a property. Subclass declares a different property with the same name
7 // (such as different type or attributes). Do not @synthesize-by-default in the subclass. P2
8 // Superclass conforms to a protocol that declares a property. Subclass redeclares the 
9 // same property.  Do not @synthesize-by-default in the subclass. P3
10 // Superclass conforms to a protocol that declares a property. Subclass conforms to the 
11 // same protocol or a derived protocol. Do not @synthesize-by-default in the subclass. P4
14 @protocol PROTO
15   @property int P3;
16   @property int P4;
17 @end
19 @protocol PROTO1 <PROTO> 
20   @property int IMP1;
21 @end
23 @interface Super <PROTO>
24   @property int P1;
25   @property (copy) id P2;
26 @end
28 @interface Sub : Super <PROTO1>
29   @property int P1;
30   @property (nonatomic, retain) id P2; // expected-warning {{property 'P2' 'copy' attribute does not match the property inherited from 'Super'}} \
31                                        // expected-warning {{property 'P2' 'atomic' attribute does not match the property inherited from 'Super'}}
32   @property int P3;
33   @property int IMP2;
34 @end
36 @implementation Sub 
37 @end