[cfe-commits] r67059 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ lib/AST/ lib/CodeGen/ lib/Sema/ test/Parser/ test/SemaCXX/

Douglas Gregor dgregor at apple.com
Tue Mar 24 16:52:53 PDT 2009


On Mar 22, 2009, at 4:31 PM, Sebastian Redl wrote:

> Douglas Gregor wrote:
>>
>> It looks like you haven't implemented the implicit conversion ranking
>> logic for rvalue reference bindings. which would go near the end of
>> Sema::CompareStandardConversionSequences. This logic should be able  
>> to
>> choose appropriately between binding to "const X&" and binding to
>> "X&&" for rvalues. I've checked in a commented-out, FIXME'd test case
>> in rval-references.cpp that's currently not working.
>
> Hi Doug,
>
> Trying to implement this, but it's a mess. The distinction hinges on
> three bits of information:
> 1) Is the bound expression an rvalue?
> 2) Is the binding reference rvalue or lvalue?
> 3) Is the conversion performed for the implicit object parameter of a
> member function without a ref qualifier?
>
> None of this information is available in the  
> StandardConversionSequence
> objects I get. I'd extend them, but I simply don't get where these
> objects are filled with data. Can you help me out?

Sema::CheckReferenceInit implements all of the reference-binding  
logic. I suggest extending the StandardConversionSequence with the  
flags that you need to implement these semantics, and set those values  
in Sema::CheckReferenceInit.

	- Doug



More information about the cfe-commits mailing list