[cfe-commits] r143399 - in /cfe/trunk: lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGExpr.cpp test/CodeGenCXX/block-rvalue-reference-capture.cpp

jahanian fjahanian at apple.com
Wed Nov 2 10:57:31 PDT 2011


On Nov 2, 2011, at 10:19 AM, Douglas Gregor wrote:

> 
> 
>> Alternatively, we could just forbid the capturing of rvalue references. 
>> Let the user make an explicit choice by either creating a local copy or 
>> a local lvalue reference.
> 
> 
> This might just be the best solution, since the only seems that is clear is that there are no clear semantics :)
> 
> Forcing users to perform the capture makes them choose between, e.g.,
> 
> 	__block T captured_x = move(x);

Yes.

> 
> or
> 
> 	__block T &captured_x = x;

Wouldn't you be passing down reference to the temporary to the block here? Or, does semantic of rvalue-reference requires a copy
being made here?

- Fariborz

> 
> 	- Doug
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list