This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/44158] [C++0x] wrong overload resolution for copy-initialization from an rvalue



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]