diff options
author | Steve Naroff <snaroff@apple.com> | 2008-09-30 00:24:17 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-09-30 00:24:17 +0000 |
commit | fbbe0ac428f804184c1b7c24723dc6cebbe11d90 (patch) | |
tree | a8bbf3331e81c86977d23f58865a7ce1aed02198 | |
parent | 3b844483bb2cdab074adbdcdbd538ce432f15887 (diff) |
Fix <rdar://problem/6247781> Parser rejecting properly mismatched properties.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56821 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 4e05a137a5..bb0923003b 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/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); |