diff options
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 15 | ||||
-rw-r--r-- | test/SemaObjC/property-inherited.m | 4 | ||||
-rw-r--r-- | test/SemaObjCXX/property-type-mismatch.mm | 1 |
3 files changed, 12 insertions, 8 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; } } diff --git a/test/SemaObjC/property-inherited.m b/test/SemaObjC/property-inherited.m index 5c5631e6fb..11ef2befa9 100644 --- a/test/SemaObjC/property-inherited.m +++ b/test/SemaObjC/property-inherited.m @@ -1,6 +1,8 @@ // RUN: %clang_cc1 %s -fsyntax-only -verify +// RUN: %clang_cc1 -x objective-c++ %s -fsyntax-only -verify -// <rdar://problem/6497242> Inherited overridden protocol declared objects don't work +// rdar://6497242 Inherited overridden protocol declared objects don't work +// rdar://9740328 Case for c++ @protocol NSObject @end @interface NSObject @end diff --git a/test/SemaObjCXX/property-type-mismatch.mm b/test/SemaObjCXX/property-type-mismatch.mm index a818b2d44c..059793cf5c 100644 --- a/test/SemaObjCXX/property-type-mismatch.mm +++ b/test/SemaObjCXX/property-type-mismatch.mm @@ -1,6 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s // rdar://9740328 -// XFAIL: * @protocol P1; |