http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57064



--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> 2013-04-25 07:08:07 
UTC ---

(In reply to comment #6)

> void f(A &&a)

> {

>     std::move(a).p();

> }

> 

> _Z1fO1A:

>         .cfi_startproc

>         jmp     _ZNR1A1pEv@PLT  #

>         .cfi_endproc

> 

> Then this looks like a bug in 4.8.1.



Indeed, I get s/R/O/ with 4.9.



> But then are we in agreement that a.p() in that function above should call the

> lvalue-ref overload?



Yes.



> It does make the feature sligthly less useful for me. It

> would require writing:

> 

>     return std::move(std::move(std::move(std::move(QString("%1 %2 %3 %4")

>                                                    .arg(42))

>                                           .arg(47))

>                                .arg(-42))

>                      .arg(-47));



Why? You are not naming those return values, so they are still rvalues and will

use the && overload. (not sure why Qstring doesn't provide a mutating interface

for arg)

Reply via email to