cxx0x-cursory-default-delete.cpp [plain text]
struct non_copiable {
non_copiable(const non_copiable&) = delete; non_copiable& operator = (const non_copiable&) = delete; non_copiable() = default;
};
struct non_const_copy {
non_const_copy(non_const_copy&);
non_const_copy& operator = (non_const_copy&) &;
non_const_copy& operator = (non_const_copy&) &&;
non_const_copy() = default; };
non_const_copy::non_const_copy(non_const_copy&) = default; non_const_copy& non_const_copy::operator = (non_const_copy&) & = default; non_const_copy& non_const_copy::operator = (non_const_copy&) && = default;
void fn1 () {
non_copiable nc;
non_copiable nc2 = nc; nc = nc;
non_const_copy ncc;
non_const_copy ncc2 = ncc;
ncc = ncc2;
const non_const_copy cncc{};
const non_const_copy cncc1; non_const_copy ncc3 = cncc; ncc = cncc; };
struct non_const_derived : non_const_copy {
non_const_derived(const non_const_derived&) = default; non_const_derived& operator =(non_const_derived&) = default;
};
struct bad_decls {
bad_decls(volatile bad_decls&) = default; bad_decls&& operator = (bad_decls) = default; bad_decls& operator = (volatile bad_decls&) = default; bad_decls& operator = (const bad_decls&) const = default; };
struct A {}; struct B {};
struct except_spec_a {
virtual ~except_spec_a() throw(A);
except_spec_a() throw(A);
};
struct except_spec_b {
virtual ~except_spec_b() throw(B);
except_spec_b() throw(B);
};
struct except_spec_d_good : except_spec_a, except_spec_b {
~except_spec_d_good();
};
except_spec_d_good::~except_spec_d_good() = default;
struct except_spec_d_bad : except_spec_a, except_spec_b {
~except_spec_d_bad() = default;
};
struct except_spec_d_mismatch : except_spec_a, except_spec_b {
except_spec_d_mismatch() throw(A) = default;
};
struct except_spec_d_match : except_spec_a, except_spec_b {
except_spec_d_match() throw(A, B) = default;
};
struct S { S(); };
S::S() __attribute((pure)) = default;