This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50500] New: [C++0x] [DR 1082] move constructor should cause copy constructor to be deleted, but still declared
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Sep 2011 23:05:28 +0000
- Subject: [Bug c++/50500] New: [C++0x] [DR 1082] move constructor should cause copy constructor to be deleted, but still declared
- Auto-submitted: auto-generated
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" }
}