* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / implicit3.C
blob8176a6e187800143da8c4b05cc008787d614ca12
1 // Basic runtime test for implicit move constructor
2 // { dg-do run { target c++11 } }
4 int m;
6 struct A
8   A() = default;
9   A(A&&) { ++m; }
10   A& operator=(A&&) { ++m; return *this; }
13 struct B
15   B() = default;
16   B(const B&);
17   B(B&&) { ++m; }
18   B& operator=(const B&);
19   B& operator=(B&&) { ++m; return *this; }
22 struct C
24   C() = default;
25   C(C&);
26   C(C&&) { ++m; }
27   C& operator=(C&);
28   C& operator=(C&&) { ++m; return *this; }
31 struct D: public A, public B
33   C c;
34   int i;
37 struct E: public A, public B
39   C c;
40   int i;
41   E() = default;
42   E(E&&) = default;
43   E& operator=(E&&) = default;
46 int main()
48   D d1;
49   D d2 (static_cast<D&&>(d1));
50   d1 = static_cast<D&&>(d2);
51   E e1;
52   E e2 (static_cast<E&&>(e1));
53   e1 = static_cast<E&&>(e2);
54   return m != 12;