//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // type_traits // has_nothrow_copy_assign #include template void test_has_nothrow_assign() { static_assert( std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert( std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); } template void test_has_not_nothrow_assign() { static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); static_assert(!std::has_nothrow_copy_assign::value, ""); } class Empty { }; class NotEmpty { virtual ~NotEmpty(); }; union Union {}; struct bit_zero { int : 0; }; class Abstract { virtual ~Abstract() = 0; }; struct A { A& operator=(const A&); }; int main() { test_has_not_nothrow_assign(); test_has_not_nothrow_assign(); test_has_not_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); test_has_nothrow_assign(); }