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

Fariborz Jahanian fjahanian at apple.com
Wed Oct 7 10:28:02 PDT 2009


On Oct 7, 2009, at 9:01 AM, Douglas Gregor wrote:

>
> On Oct 6, 2009, at 4:08 PM, Fariborz Jahanian wrote:
>
>>
>> +void foo(C c, B b, int A::* pmf) {
>> +        // FIXME. Bug or correct? gcc accepts it. It requires  
>> derived-to-base followed by user defined conversion to work.
>> +	int j = c->*pmf; // expected-error {{left hand operand to ->*  
>> must be a pointer to class compatible with the right hand operand,  
>> but is 'struct C'}}
>
> GCC is correct. I'm guessing it's because of this FIXME in  
> BuiltinCandidateTypeSet::AddTypesConvertedFrom:
>
>      // FIXME: Visit conversion functions in the base classes, too.
>
> so, we're not seeing the conversion function B::operator A*() when  
> we look for user-defined conversions from C.

This was indeed the problem. Fixed in http://llvm.org/viewvc/llvm-project?view=rev&revision=83472

- Fariborz

>
>
> Thanks, Fariborz!
>
> 	- Doug




More information about the cfe-commits mailing list