------- Comment #5 from paolo dot carlini at oracle dot com  2010-05-16 21:25 
-------
To be safe, let's reopen the bug. For the record, this works:

#include <cassert>

struct X
{
  X(int i) : i_(i) {}
  X(X&& x) : i_(x.i_) { x.i_ = 0; }
  int i_;

  X(const X&) = delete;
};

int main()
{
  X x(42);
  X y = static_cast<X&&>(x);
  assert( y.i_ == 42 );
  assert( x.i_ == 0 );
}


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


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

Reply via email to