From: Fariborz Jahanian Date: Fri, 9 Oct 2009 16:34:40 +0000 (+0000) Subject: Use the new API for applying the qualifiers on built-in '->*' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5ecd5399421799892a2b3dc5456e816bd6d827ab;p=clang Use the new API for applying the qualifiers on built-in '->*' operator's types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83648 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index f2142c5089..f710f1e2d5 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -3690,12 +3690,11 @@ Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op, Ptr != CandidateTypes.pointer_end(); ++Ptr) { QualType C1Ty = (*Ptr); QualType C1; - unsigned CV1; + QualifierCollector Q1; if (const PointerType *PointerTy = C1Ty->getAs()) { - C1 = PointerTy->getPointeeType().getUnqualifiedType(); + C1 = QualType(Q1.strip(PointerTy->getPointeeType()), 0); if (!isa(C1)) continue; - CV1 = PointerTy->getPointeeType().getCVRQualifiers(); } for (BuiltinCandidateTypeSet::iterator MemPtr = CandidateTypes.member_pointer_begin(), @@ -3709,8 +3708,7 @@ Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op, QualType ParamTypes[2] = { *Ptr, *MemPtr }; // build CV12 T& QualType T = mptr->getPointeeType(); - unsigned CV2 = T.getCVRQualifiers(); - T = Context.getCVRQualifiedType(T, (CV1 | CV2)); + T = Q1.apply(T); QualType ResultTy = Context.getLValueReferenceType(T); AddBuiltinCandidate(ResultTy, ParamTypes, Args, 2, CandidateSet); }