summaryrefslogtreecommitdiff
path: root/test/SemaObjCXX/property-synthesis-error.mm
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-10-06 18:38:18 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-10-06 18:38:18 +0000
commit57e264e9f4ff0a72f3585a960cdf63437b76fa93 (patch)
tree3b1ce9a1319ede79cc801bedc4f04ed86de5be2e /test/SemaObjCXX/property-synthesis-error.mm
parentd51e43af0b3a6897b971f316c4de2035ec82d1f2 (diff)
downloadclang-57e264e9f4ff0a72f3585a960cdf63437b76fa93.tar.gz
clang-57e264e9f4ff0a72f3585a960cdf63437b76fa93.tar.bz2
clang-57e264e9f4ff0a72f3585a960cdf63437b76fa93.tar.xz
objc++: For atomic properties of c++ class objec typet, appropriate
operator= is called. Issue a warning for non-trivial case until runtime support is provided. // rdar://6137845 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141302 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjCXX/property-synthesis-error.mm')
-rw-r--r--test/SemaObjCXX/property-synthesis-error.mm29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/SemaObjCXX/property-synthesis-error.mm b/test/SemaObjCXX/property-synthesis-error.mm
index c67f0a45c7..f79a56db6c 100644
--- a/test/SemaObjCXX/property-synthesis-error.mm
+++ b/test/SemaObjCXX/property-synthesis-error.mm
@@ -30,3 +30,32 @@ int main(void)
{
return 0;
}
+
+// rdar://6137845
+class TCPPObject
+{
+public:
+ TCPPObject(const TCPPObject& inObj);
+ TCPPObject();
+ ~TCPPObject();
+ TCPPObject& operator=(const TCPPObject& inObj);
+private:
+ void* fData;
+};
+
+@interface MyDocument
+{
+@private
+ TCPPObject _cppObject;
+ TCPPObject _ncppObject;
+}
+@property (assign, readwrite) const TCPPObject& cppObject;
+@property (assign, readwrite, nonatomic) const TCPPObject& ncppObject;
+@end
+
+@implementation MyDocument
+
+@synthesize cppObject = _cppObject; // expected-warning {{atomic property of type 'const TCPPObject &' synthesizing setter using non-trivial assignmentoperator}}
+@synthesize ncppObject = _ncppObject;
+
+@end