aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-03-15 18:36:00 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-03-15 18:36:00 +0000
commitee9ca6966d63419e4da1ea54151864a4ed8daeed (patch)
treed582d0e5dc3f364cda31cf3906e43dd401f4bc43 /lib/Sema/SemaOverload.cpp
parent8efb5812b8f49e6c5cb4635e39e4cacafd1ae73c (diff)
objective-c++ must take into account qualifiers when
considering valid objc pointer converions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98557 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index ff59fc3a7d..a58b33f97f 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -1135,6 +1135,12 @@ bool Sema::isObjCPointerConversion(QualType FromType, QualType ToType,
// Objective C++: We're able to convert from a pointer to an
// interface to a pointer to a different interface.
if (Context.canAssignObjCInterfaces(ToObjCPtr, FromObjCPtr)) {
+ const ObjCInterfaceType* LHS = ToObjCPtr->getInterfaceType();
+ const ObjCInterfaceType* RHS = FromObjCPtr->getInterfaceType();
+ if (getLangOptions().CPlusPlus && LHS && RHS &&
+ !ToObjCPtr->getPointeeType().isAtLeastAsQualifiedAs(
+ FromObjCPtr->getPointeeType()))
+ return false;
ConvertedType = ToType;
return true;
}