[Bug c++/50500] New: [C++0x] [DR 1082] move constructor should cause copy constructor to be deleted, but still declared
jason at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 23 23:59:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50500
Bug #: 50500
Summary: [C++0x] [DR 1082] move constructor should cause copy
constructor to be deleted, but still declared
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: jason@gcc.gnu.org
G++ still suppresses the copy constructor declaration when there is a move
constructor, which was changed by DR 1082.
This should complain about a deleted function:
template <class T> T&& move(T& t);
struct X
{
X() : x(1) {}
explicit X(X&& other) : x(other.x) { other.x = -1; }
int x;
};
int main()
{
X x;
X x2 = move(x); // { dg-error "deleted" }
}
More information about the Gcc-bugs
mailing list