diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-02 18:54:58 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-02 18:54:58 +0000 |
commit | 6a73384b53823b224a869d8700c9aac705360d8a (patch) | |
tree | 24628e9753236a233ecce6b0613f9da2a78a5571 /clang/lib/Sema/SemaObjCProperty.cpp | |
parent | 510340fdc2c970b9812494a92ab46023ff5fdc33 (diff) | |
download | bcm5719-llvm-6a73384b53823b224a869d8700c9aac705360d8a.tar.gz bcm5719-llvm-6a73384b53823b224a869d8700c9aac705360d8a.zip |
objective-c: When redeclaraing in continuation class a 'readonly'
property to 'readwrite', also allow redeclaration of
property type to a narrowring object type.
// rdar://10790488
llvm-svn: 149614
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index b4aee7c0ddd..7f6d8c34f4c 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -276,11 +276,18 @@ Sema::HandlePropertyInClassExtension(Scope *S, L->AddedObjCPropertyInClassExtension(PDecl, /*OrigProp=*/0, CDecl); return PDecl; } - if (PIDecl->getType().getCanonicalType() - != PDecl->getType().getCanonicalType()) { - Diag(AtLoc, - diag::err_type_mismatch_continuation_class) << PDecl->getType(); - Diag(PIDecl->getLocation(), diag::note_property_declare); + if (!Context.hasSameType(PIDecl->getType(), PDecl->getType())) { + bool IncompatibleObjC = false; + QualType ConvertedType; + if (!isa<ObjCObjectPointerType>(PIDecl->getType()) || + !isa<ObjCObjectPointerType>(PDecl->getType()) || + (!isObjCPointerConversion(PDecl->getType(), PIDecl->getType(), + ConvertedType, IncompatibleObjC)) + || IncompatibleObjC) { + Diag(AtLoc, + diag::err_type_mismatch_continuation_class) << PDecl->getType(); + Diag(PIDecl->getLocation(), diag::note_property_declare); + } } // The property 'PIDecl's readonly attribute will be over-ridden |