Prazek added a comment.

In http://reviews.llvm.org/D21303#460814, @alexfh wrote:

> 3. What's so special about `return`? Looks like a more general problem is: 
> passing an lvalue to a function/constructor/operator by const reference where 
> it could instead be moved (the lvalue isn't used afterwards and the 
> appropriate overload for rvalue reference is available).


Yes, you are right. We could generalize it more to suggest std::move for any 
last usage of variable (if there would be rvalue overload), but it is harde to 
do than this. The special thing about return, is that in most cases you 
shouldn't write 'return std::move(...)', so we want to find the cases where you 
should do it.


Repository:
  rL LLVM

http://reviews.llvm.org/D21303



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to