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++/50500] New: [C++0x] [DR 1082] move constructor should cause copy constructor to be deleted, but still declared


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


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