Fix <rdar://problem/6239726> Parser rejects: type of property 'list' does not match type of ivar
and
http://llvm.org/bugs/show_bug.cgi?id=2893
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57640 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 05c3bc7..6375d91 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1274,9 +1274,7 @@
// Check that type of property and its ivar are type compatible.
if (PropType != IvarType) {
- // A readonly property is allowed to be a sub-class of the ivar type.
- if (!property->isReadOnly() ||
- CheckAssignmentConstraints(PropType, IvarType) != Compatible) {
+ if (CheckAssignmentConstraints(PropType, IvarType) != Compatible) {
Diag(PropertyLoc, diag::error_property_ivar_type, property->getName(),
Ivar->getName());
return 0;