Use the new API for applying the qualifiers on built-in '->*'

operator's types.

llvm-svn: 83648
This commit is contained in:
Fariborz Jahanian
2009-10-09 16:34:40 +00:00
parent 31c4d8b0ba
commit 4dc1246d87

View File

@@ -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<PointerType>()) {
C1 = PointerTy->getPointeeType().getUnqualifiedType();
C1 = QualType(Q1.strip(PointerTy->getPointeeType()), 0);
if (!isa<RecordType>(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);
}