aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-05-18 23:04:17 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-05-18 23:04:17 +0000
commit62ac5d01aade35790a6d8e814edb21062da5d3f7 (patch)
tree92317a7f9af32efe0f142d32afddae245f7a9cc9 /lib/Sema/SemaObjCProperty.cpp
parentac06a0e1e3feb95c2ffd352c086882b492a65b99 (diff)
Misc. fixes to bring Objetive-C++'s handling of
gc attributes to be inline with Objective-C (for radar 7925141). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--lib/Sema/SemaObjCProperty.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 453ea25859..4c89a118bc 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -383,7 +383,16 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(Scope *S,
// Check that type of property and its ivar are type compatible.
if (PropType != IvarType) {
- if (CheckAssignmentConstraints(PropType, IvarType) != Compatible) {
+ bool compat = false;
+ if (isa<ObjCObjectPointerType>(PropType)
+ && isa<ObjCObjectPointerType>(IvarType))
+ compat =
+ Context.canAssignObjCInterfaces(
+ PropType->getAs<ObjCObjectPointerType>(),
+ IvarType->getAs<ObjCObjectPointerType>());
+ else
+ compat = (CheckAssignmentConstraints(PropType, IvarType) == Compatible);
+ if (!compat) {
Diag(PropertyLoc, diag::error_property_ivar_type)
<< property->getDeclName() << PropType
<< Ivar->getDeclName() << IvarType;