diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-07-13 17:55:01 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-07-13 17:55:01 +0000 |
commit | 8beb6a2426b5a6b79ecf019316d9fbd30755e087 (patch) | |
tree | 80e9f6bf14dacbd1ce6d5dcd8014dc6a8c2d252f /lib/Sema/SemaObjCProperty.cpp | |
parent | dc00d8158db573f4a1f91cfaa2a89171c2e5f637 (diff) |
objc++: Some level of covariance is allowed in ObjC properties.
Make it also available in ObjC++ propeties. Use common code for
objc and objc++ so they don't diverge. // rdar://9740328
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index 27f25c27ad..842d614294 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -910,12 +910,15 @@ Sema::DiagnosePropertyMismatch(ObjCPropertyDecl *Property, Context.getCanonicalType(Property->getType()); if (!Context.propertyTypesAreCompatible(LHSType, RHSType)) { - // FIXME: Incorporate this test with typesAreCompatible. - if (LHSType->isObjCQualifiedIdType() && RHSType->isObjCQualifiedIdType()) - if (Context.ObjCQualifiedIdTypesAreCompatible(LHSType, RHSType, false)) - return; - Diag(Property->getLocation(), diag::warn_property_types_are_incompatible) - << Property->getType() << SuperProperty->getType() << inheritedName; + // Do cases not handled in above. + // FIXME. For future support of covariant property types, revisit this. + bool IncompatibleObjC = false; + QualType ConvertedType; + if (!isObjCPointerConversion(RHSType, LHSType, + ConvertedType, IncompatibleObjC) || + IncompatibleObjC) + Diag(Property->getLocation(), diag::warn_property_types_are_incompatible) + << Property->getType() << SuperProperty->getType() << inheritedName; } } |