summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-02-10 00:16:04 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-02-10 00:16:04 +0000
commit234c00d6d02d2124fa3abe3db4172e9edb2787fd (patch)
tree9049c27280005cc72f48bee53dc7983af29708e9 /clang/test
parent853136229b3ee8d8cd34f524321bc7e2823f7e07 (diff)
downloadbcm5719-llvm-234c00d6d02d2124fa3abe3db4172e9edb2787fd.tar.gz
bcm5719-llvm-234c00d6d02d2124fa3abe3db4172e9edb2787fd.zip
objective-C: Fixes a bogus warning due to not setting
the "nonatomic" attribute in property redeclaration in class extension. Also, improved on diagnostics in this area while at it. // rdar://13156292 llvm-svn: 174821
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaObjC/property-3.m21
-rw-r--r--clang/test/SemaObjC/property-4.m2
-rw-r--r--clang/test/SemaObjC/property-category-3.m2
3 files changed, 22 insertions, 3 deletions
diff --git a/clang/test/SemaObjC/property-3.m b/clang/test/SemaObjC/property-3.m
index 439dc28be9f..3f82bcc3b7c 100644
--- a/clang/test/SemaObjC/property-3.m
+++ b/clang/test/SemaObjC/property-3.m
@@ -9,6 +9,25 @@
@end
@interface NOW : I
-@property (readonly) id d1; // expected-warning {{attribute 'readonly' of property 'd1' restricts attribute 'readwrite' of property inherited from 'I'}} expected-warning {{property 'd1' 'copy' attribute does not match the property inherited from 'I'}}
+@property (readonly) id d1; // expected-warning {{attribute 'readonly' of property 'd1' restricts attribute 'readwrite' of property inherited from 'I'}} expected-warning {{'copy' attribute on property 'd1' does not match the property inherited from 'I'}}
@property (readwrite, copy) I* d2;
@end
+
+// rdar://13156292
+typedef signed char BOOL;
+
+@protocol EKProtocolCalendar
+@property (nonatomic, readonly) BOOL allowReminders;
+@property (atomic, readonly) BOOL allowNonatomicProperty; // expected-note {{property declared here}}
+@end
+
+@protocol EKProtocolMutableCalendar <EKProtocolCalendar>
+@end
+
+@interface EKCalendar
+@end
+
+@interface EKCalendar () <EKProtocolMutableCalendar>
+@property (nonatomic, assign) BOOL allowReminders;
+@property (nonatomic, assign) BOOL allowNonatomicProperty; // expected-warning {{'atomic' attribute on property 'allowNonatomicProperty' does not match the property inherited from 'EKProtocolCalendar'}}
+@end
diff --git a/clang/test/SemaObjC/property-4.m b/clang/test/SemaObjC/property-4.m
index 2168048800a..49f0958fb21 100644
--- a/clang/test/SemaObjC/property-4.m
+++ b/clang/test/SemaObjC/property-4.m
@@ -24,6 +24,6 @@
int newO;
int oldO;
}
-@property (retain) id MayCauseError; // expected-warning {{property 'MayCauseError' 'copy' attribute does not match the property inherited from 'ProtocolObject'}}
+@property (retain) id MayCauseError; // expected-warning {{'copy' attribute on property 'MayCauseError' does not match the property inherited from 'ProtocolObject'}}
@end
diff --git a/clang/test/SemaObjC/property-category-3.m b/clang/test/SemaObjC/property-category-3.m
index 47e93a33d24..9be97ae5c82 100644
--- a/clang/test/SemaObjC/property-category-3.m
+++ b/clang/test/SemaObjC/property-category-3.m
@@ -16,7 +16,7 @@
@end
@interface I (Cat2) <P1>
-@property (retain) id ID; // expected-warning {{property 'ID' 'copy' attribute does not match the property inherited from 'P1'}}
+@property (retain) id ID; // expected-warning {{'copy' attribute on property 'ID' does not match the property inherited from 'P1'}}
@end
OpenPOWER on IntegriCloud