[cfe-commits] r83429 - in /cfe/trunk: lib/Sema/SemaOverload.cpp test/SemaCXX/builtin-ptrtomember-overload.cpp

Douglas Gregor dgregor at apple.com
Wed Oct 7 09:45:32 PDT 2009


On Oct 7, 2009, at 9:37 AM, Fariborz Jahanian wrote:

>
> On Oct 7, 2009, at 9:01 AM, Douglas Gregor wrote:
>
>>
>> On Oct 6, 2009, at 4:08 PM, Fariborz Jahanian wrote:
>>>
>>> +          unsigned CV1 = (*Ptr).getCVRQualifiers();
>>> +          unsigned CV2 = T.getCVRQualifiers();
>>
>> For both CV1 and CV2, we should get the canonical type (of *Ptr and  
>> T) before getting the CV qualifiers. Otherwise, we won't see  
>> qualifiers applied within a typedef.
>
> I think because of the following canonicalization is already done  
> for us.
>
> void
> BuiltinCandidateTypeSet::AddTypesConvertedFrom(QualType Ty,
>                                               bool  
> AllowUserConversions,
>                                               bool  
> AllowExplicitConversions) {
>  // Only deal with canonical types.
>  Ty = Context.getCanonicalType(Ty);
>  ...

Ah, right! In that case, we don't need

   C1 = Context.getCanonicalType(C1).getUnqualifiedType();

or

   C2 = Context.getCanonicalType(C2).getUnqualifiedType();

to call getCanonicalType().

	- Doug



More information about the cfe-commits mailing list