diff options
Diffstat (limited to 'test/SemaObjC')
-rw-r--r-- | test/SemaObjC/default-synthesize.m | 12 | ||||
-rw-r--r-- | test/SemaObjC/method-sentinel-attr.m | 12 | ||||
-rw-r--r-- | test/SemaObjC/property-10.m | 6 |
3 files changed, 30 insertions, 0 deletions
diff --git a/test/SemaObjC/default-synthesize.m b/test/SemaObjC/default-synthesize.m index 283ad26..0586dae 100644 --- a/test/SemaObjC/default-synthesize.m +++ b/test/SemaObjC/default-synthesize.m @@ -103,3 +103,15 @@ @implementation C (Category) // expected-note 2 {{implementation is here}} @end +// Don't complain if a property is already @synthesized by usr. +@interface D +{ +} +@property int PROP; +@end + +@implementation D +- (int) Meth { return self.PROP; } +@synthesize PROP=IVAR; +@end + diff --git a/test/SemaObjC/method-sentinel-attr.m b/test/SemaObjC/method-sentinel-attr.m index 08358cc..6ec362f 100644 --- a/test/SemaObjC/method-sentinel-attr.m +++ b/test/SemaObjC/method-sentinel-attr.m @@ -15,6 +15,12 @@ - (void) foo10 : (int)x, ... __attribute__ ((__sentinel__(1,1))); - (void) foo11 : (int)x, ... __attribute__ ((__sentinel__(1,1,3))); // expected-error {{attribute requires 0, 1 or 2 argument(s)}} - (void) foo12 : (int)x, ... ATTR; // expected-note {{method has been explicitly marked sentinel here}} + +// rdar:// 7975788 +- (id) foo13 : (id)firstObj, ... __attribute__((sentinel(0,1))); +- (id) foo14 : (id)firstObj : (Class)secondObj, ... __attribute__((sentinel(0,1))); +- (id) foo15 : (id*)firstObj, ... __attribute__((sentinel(0,1))); +- (id) foo16 : (id**)firstObj, ... __attribute__((sentinel(0,1))); @end int main () @@ -33,5 +39,11 @@ int main () [p foo7:1, NULL]; // ok [p foo12:1]; // expected-warning {{not enough variable arguments in 'foo12:' declaration to fit a sentinel}} + + // rdar:// 7975788 + [ p foo13 : NULL]; + [ p foo14 : 0 : NULL]; + [ p foo16 : NULL]; + [ p foo15 : NULL]; } diff --git a/test/SemaObjC/property-10.m b/test/SemaObjC/property-10.m index bd07df6..0119273 100644 --- a/test/SemaObjC/property-10.m +++ b/test/SemaObjC/property-10.m @@ -20,3 +20,9 @@ @property(nonatomic,copy) int (*includeMailboxCondition2)(); // expected-error {{property with 'copy' attribute must be of object type}} @end + +@interface I0() +@property (retain) int PROP; // expected-error {{property with 'retain' attribute must be of object type}} +@property(nonatomic,copy) int (*PROP1)(); // expected-error {{property with 'copy' attribute must be of object type}} +@end + |