From: Fariborz Jahanian Date: Sat, 21 Aug 2010 17:11:09 +0000 (+0000) Subject: twik to my previous patch for pr7936. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=957b4dfd64bce51be396048e6c10485229f4bc7b;p=clang twik to my previous patch for pr7936. Build qualified version of ObjC pointers (not pointers) when doing overload resolution. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111740 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 6108d5261e..25a3a2e9d0 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -4171,9 +4171,12 @@ BuiltinCandidateTypeSet::AddPointerWithMoreQualifiedTypeVariants(QualType Ty, QualType PointeeTy; const PointerType *PointerTy = Ty->getAs(); + bool buildObjCPtr = false; if (!PointerTy) { - if (const ObjCObjectPointerType *PTy = Ty->getAs()) + if (const ObjCObjectPointerType *PTy = Ty->getAs()) { PointeeTy = PTy->getPointeeType(); + buildObjCPtr = true; + } else assert(false && "type was not a pointer type!"); } @@ -4200,7 +4203,10 @@ BuiltinCandidateTypeSet::AddPointerWithMoreQualifiedTypeVariants(QualType Ty, if ((CVR & Qualifiers::Volatile) && !hasVolatile) continue; if ((CVR & Qualifiers::Restrict) && !hasRestrict) continue; QualType QPointeeTy = Context.getCVRQualifiedType(PointeeTy, CVR); - PointerTypes.insert(Context.getPointerType(QPointeeTy)); + if (!buildObjCPtr) + PointerTypes.insert(Context.getPointerType(QPointeeTy)); + else + PointerTypes.insert(Context.getObjCObjectPointerType(QPointeeTy)); } return true;