summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-09-30 00:24:17 +0000
committerSteve Naroff <snaroff@apple.com>2008-09-30 00:24:17 +0000
commit506e717e4f20ab9f74feefa0e8ce19fdff9bec25 (patch)
tree8ae03933bd5161fc8faa522d7db36c04da6a6964 /clang/lib
parent7273d01dd4c662cee3035f399ec52ef4d26ef9d8 (diff)
downloadbcm5719-llvm-506e717e4f20ab9f74feefa0e8ce19fdff9bec25.tar.gz
bcm5719-llvm-506e717e4f20ab9f74feefa0e8ce19fdff9bec25.zip
Fix <rdar://problem/6247781> Parser rejecting properly mismatched properties.
llvm-svn: 56821
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 4e05a137a50..bb0923003b6 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -1254,14 +1254,14 @@ Sema::DeclTy *Sema::ActOnPropertyImplDecl(SourceLocation AtLoc,
PropertyId->getName());
return 0;
}
- // Check that type of property and its ivar match.
- if (Context.getCanonicalType(Ivar->getType()) !=
- Context.getCanonicalType(property->getType())) {
+ // Check that type of property and its ivar are type compatible.
+ // A property is allowed to be a sub-class of the instance variable type.
+ if (CheckAssignmentConstraints(property->getType(),
+ Ivar->getType()) != Compatible) {
Diag(PropertyLoc, diag::error_property_ivar_type, property->getName(),
Ivar->getName());
return 0;
}
-
} else if (PropertyIvar) {
// @dynamic
Diag(PropertyLoc, diag::error_dynamic_property_ivar_decl);
OpenPOWER on IntegriCloud