зеркало из https://github.com/microsoft/clang-1.git
Objective-C pointer conversions to 'id' or qualified 'id' subsume
cv-qualification conversions. More specifically, there's an implicit cv-qualification conversion (even one that drops qualifiers) when converting to 'id' or qualified 'id'. Fixes <rdar://problem/8734046>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121047 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
409fa9ab95
Коммит
143c7acef3
|
@ -1365,6 +1365,11 @@ BuildSimilarlyQualifiedPointerType(const Type *FromPtr,
|
|||
assert((FromPtr->getTypeClass() == Type::Pointer ||
|
||||
FromPtr->getTypeClass() == Type::ObjCObjectPointer) &&
|
||||
"Invalid similarly-qualified pointer type");
|
||||
|
||||
/// \brief Conversions to 'id' subsume cv-qualifier conversions.
|
||||
if (ToType->isObjCIdType() || ToType->isObjCQualifiedIdType())
|
||||
return ToType.getUnqualifiedType();
|
||||
|
||||
QualType CanonFromPointee
|
||||
= Context.getCanonicalType(FromPtr->getPointeeType());
|
||||
QualType CanonToPointee = Context.getCanonicalType(ToPointee);
|
||||
|
|
|
@ -142,3 +142,12 @@ namespace rdar8714395 {
|
|||
|
||||
|
||||
}
|
||||
|
||||
namespace rdar8734046 {
|
||||
void f1(id);
|
||||
void f2(id<P0>);
|
||||
void g(const A *a) {
|
||||
f1(a);
|
||||
f2(a);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче