OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [implicit12.C] - Rev 701

Go to most recent revision | Compare with Previous | Blame | View Log

// PR c++/50500
// { dg-options "-std=c++0x" }

// If a class declares move operations, the implicitly declared copy
// operations are deleted.
struct A
{
  A();
  A(A&&);
  A& operator=(A&&);
};

// But they can still be explicitly defaulted.
struct B
{
  B();
  B(B&&);
  B(const B&) = default;
  B& operator=(B&&);
  B& operator=(const B&) = default;
};

struct C
{
  C();
  C(C&&);
};

struct D
{
  D();
  D& operator=(D&&);
};

int main()
{
  A a;
  A a2 (a);                     // { dg-error "deleted" }
  a2 = a;                       // { dg-error "deleted" }

  B b;
  B b2 (b);
  b2 = b;

  C c;
  C c2(c);                      // { dg-error "deleted" }
  c2 = c;                       // { dg-error "deleted" }

  D d;
  D d2(d);                      // { dg-error "deleted" }
  d2 = d;                       // { dg-error "deleted" }
}

// { dg-prune-output "because" }

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.