1 // I, Howard Hinnant, hereby place this code in the public domain.
3 // Test that move constructor and move assignement are not special.
4 // That is, their presence should not inhibit compiler generated
5 // copy ctor or assignment. Rather they should overload with the
6 // compiler generated special members.
9 // { dg-options "-std=c++0x" }
13 template <bool> struct sa;
14 template <> struct sa<true> {};
16 struct one {char x[1];};
17 struct two {char x[2];};
25 base(const base&) {++copy;}
26 base& operator=(const base&) {++assign; return *this;}
34 derived& operator=(derived&&) {return *this;}
40 derived d2(static_cast<derived&&>(d)); // should not call base::(const base&)
42 derived d3(d); // should call base::(const base&)
44 d2 = static_cast<derived&&>(d); // should not call base::operator=
46 d3 = d; // should call base::operator=