diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2015-04-08 21:34:04 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2015-04-08 21:34:04 +0000 |
commit | 576ff1283997d67e89bc958a1eeb25215a3c66c2 (patch) | |
tree | 99c54b685d106c20aa1faf140f73750c983fa6e5 /clang/lib/Sema | |
parent | bda7aa5938862a80f9aae889f5a18fd4a2bbae1c (diff) | |
download | bcm5719-llvm-576ff1283997d67e89bc958a1eeb25215a3c66c2.tar.gz bcm5719-llvm-576ff1283997d67e89bc958a1eeb25215a3c66c2.zip |
[Objective-C Sema] Use canonical type of properties when comparing
redeclaration of property in class extension and to avoid
bogus error. rdar://20469452
llvm-svn: 234440
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index f4f43360f5e..5e7b4b8b859 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -407,9 +407,11 @@ Sema::HandlePropertyInClassExtension(Scope *S, // this conversion is safe only because the wider type is for a 'readonly' // property in primary class and 'narrowed' type for a 'readwrite' property // in continuation class. - if (!isa<ObjCObjectPointerType>(PIDecl->getType()) || - !isa<ObjCObjectPointerType>(PDecl->getType()) || - (!isObjCPointerConversion(PDecl->getType(), PIDecl->getType(), + QualType PrimaryClassPropertyT = Context.getCanonicalType(PIDecl->getType()); + QualType ClassExtPropertyT = Context.getCanonicalType(PDecl->getType()); + if (!isa<ObjCObjectPointerType>(PrimaryClassPropertyT) || + !isa<ObjCObjectPointerType>(ClassExtPropertyT) || + (!isObjCPointerConversion(ClassExtPropertyT, PrimaryClassPropertyT, ConvertedType, IncompatibleObjC)) || IncompatibleObjC) { Diag(AtLoc, |