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] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/50500
2
// { dg-options "-std=c++0x" }
3
 
4
// If a class declares move operations, the implicitly declared copy
5
// operations are deleted.
6
struct A
7
{
8
  A();
9
  A(A&&);
10
  A& operator=(A&&);
11
};
12
 
13
// But they can still be explicitly defaulted.
14
struct B
15
{
16
  B();
17
  B(B&&);
18
  B(const B&) = default;
19
  B& operator=(B&&);
20
  B& operator=(const B&) = default;
21
};
22
 
23
struct C
24
{
25
  C();
26
  C(C&&);
27
};
28
 
29
struct D
30
{
31
  D();
32
  D& operator=(D&&);
33
};
34
 
35
int main()
36
{
37
  A a;
38
  A a2 (a);                     // { dg-error "deleted" }
39
  a2 = a;                       // { dg-error "deleted" }
40
 
41
  B b;
42
  B b2 (b);
43
  b2 = b;
44
 
45
  C c;
46
  C c2(c);                      // { dg-error "deleted" }
47
  c2 = c;                       // { dg-error "deleted" }
48
 
49
  D d;
50
  D d2(d);                      // { dg-error "deleted" }
51
  d2 = d;                       // { dg-error "deleted" }
52
}
53
 
54
// { dg-prune-output "because" }

powered by: WebSVN 2.1.0

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