diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-05-18 23:04:17 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-05-18 23:04:17 +0000 |
| commit | 9f963c248878374b254c76d4671eaf9106122f33 (patch) | |
| tree | 8cd1e138b1b47a6fc2318d01a4571f1aea78fdc4 /clang/lib/Sema | |
| parent | bdb604a80649754a8385b84f20744f1f0a890b03 (diff) | |
| download | bcm5719-llvm-9f963c248878374b254c76d4671eaf9106122f33.tar.gz bcm5719-llvm-9f963c248878374b254c76d4671eaf9106122f33.zip | |
Misc. fixes to bring Objetive-C++'s handling of
gc attributes to be inline with Objective-C
(for radar 7925141).
llvm-svn: 104084
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 11 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 453ea25859e..4c89a118bc9 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -383,7 +383,16 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(Scope *S, // Check that type of property and its ivar are type compatible. if (PropType != IvarType) { - if (CheckAssignmentConstraints(PropType, IvarType) != Compatible) { + bool compat = false; + if (isa<ObjCObjectPointerType>(PropType) + && isa<ObjCObjectPointerType>(IvarType)) + compat = + Context.canAssignObjCInterfaces( + PropType->getAs<ObjCObjectPointerType>(), + IvarType->getAs<ObjCObjectPointerType>()); + else + compat = (CheckAssignmentConstraints(PropType, IvarType) == Compatible); + if (!compat) { Diag(PropertyLoc, diag::error_property_ivar_type) << property->getDeclName() << PropType << Ivar->getDeclName() << IvarType; diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 365daa60183..897ee662652 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -1042,7 +1042,8 @@ Sema::IsStandardConversion(Expr* From, QualType ToType, CanonTo = Context.getCanonicalType(ToType); if (CanonFrom.getLocalUnqualifiedType() == CanonTo.getLocalUnqualifiedType() && - CanonFrom.getLocalCVRQualifiers() != CanonTo.getLocalCVRQualifiers()) { + (CanonFrom.getLocalCVRQualifiers() != CanonTo.getLocalCVRQualifiers() + || CanonFrom.getObjCGCAttr() != CanonTo.getObjCGCAttr())) { FromType = ToType; CanonFrom = CanonTo; } |

