diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-09-17 20:57:19 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-09-17 20:57:19 +0000 |
commit | 6defd9f31eec51278d056f1bff885018e2321373 (patch) | |
tree | 5d8f8516ee0a0ffe6e6522f2209fc1ba435826ee /test | |
parent | 08602359845e668194d111b794b8965358babfe6 (diff) |
objective-C: peroform property attribute consistency
checking on property declared in class extension.
// rdar://12214070
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164053 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaObjC/property-in-class-extension-1.m | 26 | ||||
-rw-r--r-- | test/SemaObjCXX/property-synthesis-error.mm | 2 |
2 files changed, 21 insertions, 7 deletions
diff --git a/test/SemaObjC/property-in-class-extension-1.m b/test/SemaObjC/property-in-class-extension-1.m index dfa5e718a4..18eae24cc1 100644 --- a/test/SemaObjC/property-in-class-extension-1.m +++ b/test/SemaObjC/property-in-class-extension-1.m @@ -35,15 +35,29 @@ @property (nonatomic, copy) NSString* addingMemoryModel; @property (nonatomic, copy) NSString* matchingMemoryModel; -@property () NSString* addingNoNewMemoryModel; -@property () NSString* none; -@property (readwrite) NSString* none1; +@property () NSString* addingNoNewMemoryModel; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}} \ + // expected-warning {{default property attribute 'assign' not appropriate for non-GC object}} +@property () NSString* none; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}} \ + // expected-warning {{default property attribute 'assign' not appropriate for non-GC object}} +@property (readwrite, retain) NSString* none1; @property (retain) NSString* changeMemoryModel; // expected-warning {{property attribute in class extension does not match the primary class}} -@property () __weak id weak_prop; -@property (readwrite) __weak id weak_prop1; +@property () __weak id weak_prop; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}} \ + // expected-warning {{default property attribute 'assign' not appropriate for non-GC object}} +@property (readwrite) __weak id weak_prop1; // expected-warning {{no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed}}\ + // expected-warning {{default property attribute 'assign' not appropriate for non-GC object}} -@property () NSString* assignProperty; +@property (assign, readwrite) NSString* assignProperty; @property (assign) NSString* readonlyProp; @end +// rdar://12214070 +@interface radar12214070 +@property (nonatomic, atomic, readonly) float propertyName; // expected-error {{property attributes 'atomic' and 'nonatomic' are mutually exclusive}} +@end + +@interface radar12214070 () +@property (atomic, nonatomic, readonly, readwrite) float propertyName; // expected-error {{property attributes 'readonly' and 'readwrite' are mutually exclusive}} \ + // expected-error {{property attributes 'atomic' and 'nonatomic' are mutually exclusive}} +@end + diff --git a/test/SemaObjCXX/property-synthesis-error.mm b/test/SemaObjCXX/property-synthesis-error.mm index 4f64a3a338..1d93523b4c 100644 --- a/test/SemaObjCXX/property-synthesis-error.mm +++ b/test/SemaObjCXX/property-synthesis-error.mm @@ -16,7 +16,7 @@ @interface MyClass () -@property (readwrite) NSMutableArray * array; +@property (readwrite, retain) NSMutableArray * array; @end |