From f263981ac8f33dce2cfd904986ee596de5ddcdb1 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 19 May 2011 10:30:20 +0000 Subject: [PATCH] [multiple changes] 2011-05-19 Daniel Krugler * testsuite/util/testsuite_tr1.h: Add test classes. * testsuite/20_util/is_nothrow_assignable/value.cc: Add. 2011-05-19 Paolo Carlini * include/std/type_traits (is_assignable, is_copy_assignable, is_move_assignable, is_nothrow_assignable, is_nothrow_copy_assignable, is_nothrow_move_assignable): Add; minor tweaks elsewhere. (has_nothrow_copy_assign): Remove. * testsuite/util/testsuite_tr1.h: Add test classes. * testsuite/20_util/is_assignable/requirements/typedefs.cc: Add. * testsuite/20_util/is_assignable/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_nothrow_assignable/value.cc: Likewise. * testsuite/20_util/is_nothrow_assignable/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_nothrow_assignable/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_move_assignable/value.cc: Likewise. * testsuite/20_util/is_move_assignable/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_move_assignable/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_copy_assignable/value.cc: Likewise. * testsuite/20_util/is_copy_assignable/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_copy_assignable/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_nothrow_move_assignable/value.cc: Likewise. * testsuite/20_util/is_nothrow_move_assignable/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_nothrow_move_assignable/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_nothrow_copy_assignable/value.cc: Likewise. * testsuite/20_util/is_nothrow_copy_assignable/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_nothrow_copy_assignable/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error line numbers. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/declval/requirements/1_neg.cc: Likewise. From-SVN: r173899 --- libstdc++-v3/ChangeLog | 46 ++ libstdc++-v3/include/std/type_traits | 114 ++- .../20_util/declval/requirements/1_neg.cc | 2 +- .../20_util/has_nothrow_copy_assign/value.cc | 57 -- .../requirements/explicit_instantiation.cc | 31 + .../requirements/typedefs.cc | 10 +- .../testsuite/20_util/is_assignable/value.cc | 675 ++++++++++++++++++ .../requirements/explicit_instantiation.cc | 30 + .../requirements/typedefs.cc | 36 + .../20_util/is_copy_assignable/value.cc | 66 ++ .../requirements/explicit_instantiation.cc | 30 + .../requirements/typedefs.cc | 36 + .../20_util/is_move_assignable/value.cc | 66 ++ .../requirements/explicit_instantiation.cc | 31 + .../requirements/typedefs.cc | 36 + .../20_util/is_nothrow_assignable/value.cc | 58 ++ .../requirements/explicit_instantiation.cc | 4 +- .../requirements/typedefs.cc | 36 + .../is_nothrow_copy_assignable/value.cc | 75 ++ .../requirements/explicit_instantiation.cc | 30 + .../requirements/typedefs.cc | 36 + .../is_nothrow_move_assignable/value.cc | 75 ++ .../make_signed/requirements/typedefs_neg.cc | 4 +- .../requirements/typedefs_neg.cc | 4 +- libstdc++-v3/testsuite/util/testsuite_tr1.h | 210 ++++++ 25 files changed, 1722 insertions(+), 76 deletions(-) delete mode 100644 libstdc++-v3/testsuite/20_util/has_nothrow_copy_assign/value.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_assignable/requirements/explicit_instantiation.cc rename libstdc++-v3/testsuite/20_util/{has_nothrow_copy_assign => is_assignable}/requirements/typedefs.cc (87%) create mode 100644 libstdc++-v3/testsuite/20_util/is_assignable/value.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_copy_assignable/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_copy_assignable/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_move_assignable/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_move_assignable/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_assignable/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_assignable/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_assignable/value.cc rename libstdc++-v3/testsuite/20_util/{has_nothrow_copy_assign => is_nothrow_copy_assignable}/requirements/explicit_instantiation.cc (89%) create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3b56f06fe24..344d1853d87 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,49 @@ +2011-05-19 Daniel Krugler + + * testsuite/util/testsuite_tr1.h: Add test classes. + * testsuite/20_util/is_nothrow_assignable/value.cc: Add. + +2011-05-19 Paolo Carlini + + * include/std/type_traits (is_assignable, is_copy_assignable, + is_move_assignable, is_nothrow_assignable, is_nothrow_copy_assignable, + is_nothrow_move_assignable): Add; minor tweaks elsewhere. + (has_nothrow_copy_assign): Remove. + * testsuite/util/testsuite_tr1.h: Add test classes. + * testsuite/20_util/is_assignable/requirements/typedefs.cc: Add. + * testsuite/20_util/is_assignable/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/is_nothrow_assignable/value.cc: Likewise. + * testsuite/20_util/is_nothrow_assignable/requirements/typedefs.cc: + Likewise. + * testsuite/20_util/is_nothrow_assignable/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/is_move_assignable/value.cc: Likewise. + * testsuite/20_util/is_move_assignable/requirements/typedefs.cc: + Likewise. + * testsuite/20_util/is_move_assignable/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/is_copy_assignable/value.cc: Likewise. + * testsuite/20_util/is_copy_assignable/requirements/typedefs.cc: + Likewise. + * testsuite/20_util/is_copy_assignable/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/is_nothrow_move_assignable/value.cc: Likewise. + * testsuite/20_util/is_nothrow_move_assignable/requirements/ + typedefs.cc: Likewise. + * testsuite/20_util/is_nothrow_move_assignable/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/is_nothrow_copy_assignable/value.cc: Likewise. + * testsuite/20_util/is_nothrow_copy_assignable/requirements/ + typedefs.cc: Likewise. + * testsuite/20_util/is_nothrow_copy_assignable/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust + dg-error line numbers. + * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: + Likewise. + * testsuite/20_util/declval/requirements/1_neg.cc: Likewise. + 2011-05-18 Jonathan Wakely * include/bits/shared_ptr_base.h: Use noexcept. Define special member diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 0560522cbfd..184e28ba8dc 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -988,10 +988,110 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public __is_nothrow_move_constructible_impl<_Tp> { }; - /// has_nothrow_copy_assign + template + class __is_assignable_helper + : public __sfinae_types + { + template + static decltype(declval<_Tp1>() = declval<_Up1>(), __one()) + __test(int); + + template + static __two __test(...); + + public: + static constexpr bool value = sizeof(__test<_Tp, _Up>(0)) == 1; + }; + + /// is_assignable + template + struct is_assignable + : public integral_constant::value> + { }; + + template::value> + struct __is_copy_assignable_impl; + + template + struct __is_copy_assignable_impl<_Tp, true> + : public false_type { }; + + template + struct __is_copy_assignable_impl<_Tp, false> + : public is_assignable<_Tp&, const _Tp&&> + { }; + + /// is_copy_assignable + template + struct is_copy_assignable + : public __is_copy_assignable_impl<_Tp> + { }; + + template::value> + struct __is_move_assignable_impl; + + template + struct __is_move_assignable_impl<_Tp, true> + : public false_type { }; + + template + struct __is_move_assignable_impl<_Tp, false> + : public is_assignable<_Tp&, _Tp&&> + { }; + + /// is_move_assignable + template + struct is_move_assignable + : public __is_move_assignable_impl<_Tp> + { }; + + template + struct __is_nt_assignable_impl + : public integral_constant() = declval<_Up>())> + { }; + + /// is_nothrow_assignable + template + struct is_nothrow_assignable + : public __and_, + __is_nt_assignable_impl<_Tp, _Up>>::type + { }; + + template::value> + struct __is_nt_copy_assignable_impl; + + template + struct __is_nt_copy_assignable_impl<_Tp, true> + : public false_type { }; + + template + struct __is_nt_copy_assignable_impl<_Tp, false> + : public is_nothrow_assignable<_Tp&, const _Tp&&> + { }; + + /// is_nothrow_copy_assignable + template + struct is_nothrow_copy_assignable + : public __is_nt_copy_assignable_impl<_Tp> + { }; + + template::value> + struct __is_nt_move_assignable_impl; + + template + struct __is_nt_move_assignable_impl<_Tp, true> + : public false_type { }; + + template + struct __is_nt_move_assignable_impl<_Tp, false> + : public is_nothrow_assignable<_Tp&, _Tp&&> + { }; + + /// is_nothrow_move_assignable template - struct has_nothrow_copy_assign - : public integral_constant + struct is_nothrow_move_assignable + : public __is_nt_move_assignable_impl<_Tp> { }; /// has_trivial_default_constructor @@ -1086,7 +1186,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool = __or_, is_function<_To>, is_array<_To>>::value> struct __is_convertible_helper - { static const bool __value = is_void<_To>::value; }; + { static constexpr bool value = is_void<_To>::value; }; template class __is_convertible_helper<_From, _To, false> @@ -1103,14 +1203,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static __two __test(...); public: - static const bool __value = sizeof(__test<_From, _To>(0)) == 1; + static constexpr bool value = sizeof(__test<_From, _To>(0)) == 1; }; /// is_convertible template struct is_convertible : public integral_constant::__value> + __is_convertible_helper<_From, _To>::value> { }; /// is_explicitly_convertible @@ -1729,7 +1829,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static __two __test(...); \ \ public: \ - static const bool value = sizeof(__test<_Tp>(0)) == 1; \ + static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; \ }; \ \ template \ diff --git a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc index 4fa005ecdd6..3ca56e9c333 100644 --- a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc +++ b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc @@ -19,7 +19,7 @@ // with this library; see the file COPYING3. If not see // . -// { dg-error "static assertion failed" "" { target *-*-* } 1615 } +// { dg-error "static assertion failed" "" { target *-*-* } 1715 } #include diff --git a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_assign/value.cc b/libstdc++-v3/testsuite/20_util/has_nothrow_copy_assign/value.cc deleted file mode 100644 index 0201c9cb91d..00000000000 --- a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_assign/value.cc +++ /dev/null @@ -1,57 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2010-06-08 Paolo Carlini -// -// Copyright (C) 2010 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include -#include -#include - -void test01() -{ - bool test __attribute__((unused)) = true; - using std::has_nothrow_copy_assign; - using namespace __gnu_test; - - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - - // Negative tests. - VERIFY( (test_property(false)) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/20_util/is_assignable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_assignable/requirements/explicit_instantiation.cc new file mode 100644 index 00000000000..f4c0e2a6430 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_assignable/requirements/explicit_instantiation.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// 2011-05-19 Paolo Carlini + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_assignable; +} diff --git a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_assign/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_assignable/requirements/typedefs.cc similarity index 87% rename from libstdc++-v3/testsuite/20_util/has_nothrow_copy_assign/requirements/typedefs.cc rename to libstdc++-v3/testsuite/20_util/is_assignable/requirements/typedefs.cc index 3781d1f9bec..d73c0c9a5ff 100644 --- a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_assign/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/is_assignable/requirements/typedefs.cc @@ -1,7 +1,9 @@ // { dg-options "-std=gnu++0x" } -// 2010-06-08 Paolo Carlini +// { dg-do compile } + +// 2011-05-19 Paolo Carlini // -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -23,12 +25,10 @@ #include -// { dg-do compile } - void test01() { // Check for required typedefs - typedef std::has_nothrow_copy_assign test_type; + typedef std::is_assignable test_type; typedef test_type::value_type value_type; typedef test_type::type type; typedef test_type::type::value_type type_value_type; diff --git a/libstdc++-v3/testsuite/20_util/is_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_assignable/value.cc new file mode 100644 index 00000000000..547f732bcc5 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_assignable/value.cc @@ -0,0 +1,675 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +using namespace __gnu_test::assign; + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +// bool is a fundamental type that does not allow assignment to an rvalue: +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +// std::nullptr_t is a fundamental type that does not allow +// assignment to an rvalue: +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +// E is not a class type and thus does not allow assignment to an rvalue: +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +// SE is not a class type and thus does not allow assignment to an rvalue: +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable>::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable&, +std::initializer_list>::value, "Error"); +static_assert(std::is_assignable&, +std::initializer_list&&>::value, "Error"); +static_assert(std::is_assignable&, const +std::initializer_list&&>::value, "Error"); +static_assert(std::is_assignable&, +std::initializer_list&>::value, "Error"); +static_assert(std::is_assignable&, const +std::initializer_list&>::value, "Error"); +static_assert(!std::is_assignable&, +std::initializer_list>::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable&>::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); + +static_assert(std::is_assignable&, +DelImplicitTo>::value, "Error"); +static_assert(std::is_assignable, +DelImplicitTo>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable&, int>::value, "Error"); +static_assert(std::is_assignable&, const int>::value, "Error"); +static_assert(!std::is_assignable&, +ImplicitTo>::value, "Error"); +static_assert(!std::is_assignable&, ImplicitTo>::value, "Error"); +static_assert(!std::is_assignable&, +ExplicitTo>::value, "Error"); +static_assert(!std::is_assignable&, ExplicitTo>::value, "Error"); + +static_assert(!std::is_assignable&, int>::value, "Error"); +static_assert(!std::is_assignable&, const +int>::value, "Error"); + +static_assert(std::is_assignable>::value, "Error"); +static_assert(!std::is_assignable>::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); +static_assert(!std::is_assignable::value, "Error"); + +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); +static_assert(std::is_assignable::value, "Error"); diff --git a/libstdc++-v3/testsuite/20_util/is_copy_assignable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_copy_assignable/requirements/explicit_instantiation.cc new file mode 100644 index 00000000000..7aaf37e8010 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_copy_assignable/requirements/explicit_instantiation.cc @@ -0,0 +1,30 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } +// 2011-05-19 Paolo Carlini + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_copy_assignable; +} diff --git a/libstdc++-v3/testsuite/20_util/is_copy_assignable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_copy_assignable/requirements/typedefs.cc new file mode 100644 index 00000000000..14366213afa --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_copy_assignable/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// 2011-05-19 Paolo Carlini +// +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_copy_assignable test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc new file mode 100644 index 00000000000..662c834bd29 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc @@ -0,0 +1,66 @@ +// { dg-options "-std=gnu++0x" } +// 2011-05-19 Paolo Carlini +// +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_copy_assignable; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + // Negative tests. + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/is_move_assignable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_move_assignable/requirements/explicit_instantiation.cc new file mode 100644 index 00000000000..e85a7464300 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_move_assignable/requirements/explicit_instantiation.cc @@ -0,0 +1,30 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } +// 2011-05-19 Paolo Carlini + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_move_assignable; +} diff --git a/libstdc++-v3/testsuite/20_util/is_move_assignable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_move_assignable/requirements/typedefs.cc new file mode 100644 index 00000000000..23b8aa81658 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_move_assignable/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// 2011-05-19 Paolo Carlini +// +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_move_assignable test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc new file mode 100644 index 00000000000..a7dff82e0bd --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc @@ -0,0 +1,66 @@ +// { dg-options "-std=gnu++0x" } +// 2011-05-19 Paolo Carlini +// +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_move_assignable; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + // Negative tests. + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/requirements/explicit_instantiation.cc new file mode 100644 index 00000000000..d3ebe8b1f7a --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/requirements/explicit_instantiation.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// 2011-05-19 Paolo Carlini + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_nothrow_assignable; +} diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/requirements/typedefs.cc new file mode 100644 index 00000000000..7baeb6f0aa5 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// 2011-05-19 Paolo Carlini +// +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +void test01() +{ + // Check for required typedefs + typedef std::is_nothrow_assignable test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/value.cc new file mode 100644 index 00000000000..6414faf0e47 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/value.cc @@ -0,0 +1,58 @@ +// { dg-options "-std=gnu++0x" } +// 2011-05-19 Paolo Carlini +// +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_nothrow_assignable; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_relationship(true)) ); + VERIFY( (test_relationship(true)) ); + + VERIFY( (test_relationship(true)) ); + VERIFY( (test_relationship(true)) ); + VERIFY( (test_relationship(true)) ); + + // Negative tests. + VERIFY( (test_relationship(false)) ); + VERIFY( (test_relationship(false)) ); + + VERIFY( (test_relationship(false)) ); + VERIFY( (test_relationship(false)) ); + VERIFY( (test_relationship(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_assign/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/requirements/explicit_instantiation.cc similarity index 89% rename from libstdc++-v3/testsuite/20_util/has_nothrow_copy_assign/requirements/explicit_instantiation.cc rename to libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/requirements/explicit_instantiation.cc index 0a4a6224b8a..406c60036f1 100644 --- a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_assign/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/requirements/explicit_instantiation.cc @@ -2,7 +2,7 @@ // { dg-do compile } // 2010-06-08 Paolo Carlini -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -26,5 +26,5 @@ namespace std { typedef short test_type; - template struct has_nothrow_copy_assign; + template struct is_nothrow_copy_assignable; } diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/requirements/typedefs.cc new file mode 100644 index 00000000000..52876fe31a2 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// 2010-06-08 Paolo Carlini +// +// Copyright (C) 2010, 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_nothrow_copy_assignable test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc new file mode 100644 index 00000000000..f008bfca7c1 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc @@ -0,0 +1,75 @@ +// { dg-options "-std=gnu++0x" } +// 2010-06-08 Paolo Carlini +// +// Copyright (C) 2010, 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_nothrow_copy_assignable; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + VERIFY( (test_property(true)) ); + + // Negative tests. + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/requirements/explicit_instantiation.cc new file mode 100644 index 00000000000..c360102128e --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/requirements/explicit_instantiation.cc @@ -0,0 +1,30 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } +// 2011-05-19 Paolo Carlini + +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_nothrow_move_assignable; +} diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/requirements/typedefs.cc new file mode 100644 index 00000000000..33e0cba43d7 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/requirements/typedefs.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// 2011-05-19 Paolo Carlini +// +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_nothrow_move_assignable test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc new file mode 100644 index 00000000000..3eec9b086d5 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc @@ -0,0 +1,75 @@ +// { dg-options "-std=gnu++0x" } +// 2011-05-19 Paolo Carlini +// +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_nothrow_move_assignable; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + // Negative tests. + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc index 01a2068e6e7..c92df36b348 100644 --- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc +++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc @@ -48,5 +48,5 @@ void test01() // { dg-error "instantiated from here" "" { target *-*-* } 40 } // { dg-error "instantiated from here" "" { target *-*-* } 42 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1401 } -// { dg-error "declaration of" "" { target *-*-* } 1365 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1501 } +// { dg-error "declaration of" "" { target *-*-* } 1465 } diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc index 7dd19d63127..2bb62cba715 100644 --- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc +++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc @@ -48,5 +48,5 @@ void test01() // { dg-error "instantiated from here" "" { target *-*-* } 40 } // { dg-error "instantiated from here" "" { target *-*-* } 42 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1325 } -// { dg-error "declaration of" "" { target *-*-* } 1289 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1425 } +// { dg-error "declaration of" "" { target *-*-* } 1389 } diff --git a/libstdc++-v3/testsuite/util/testsuite_tr1.h b/libstdc++-v3/testsuite/util/testsuite_tr1.h index 9265bc41216..03cc431c1cf 100644 --- a/libstdc++-v3/testsuite/util/testsuite_tr1.h +++ b/libstdc++-v3/testsuite/util/testsuite_tr1.h @@ -204,6 +204,42 @@ namespace __gnu_test { ExceptMoveConsClass(ExceptMoveConsClass&&) noexcept(false); }; + + struct NoexceptCopyAssignClass + { + NoexceptCopyAssignClass& + operator=(const NoexceptCopyAssignClass&) noexcept(true); + }; + + struct ExceptCopyAssignClass + { + ExceptCopyAssignClass& + operator=(const ExceptCopyAssignClass&) noexcept(false); + }; + + struct NoexceptMoveAssignClass + { + NoexceptMoveAssignClass& + operator=(NoexceptMoveAssignClass&&) noexcept(true); + }; + + struct ExceptMoveAssignClass + { + ExceptMoveAssignClass& + operator=(ExceptMoveAssignClass&&) noexcept(false); + }; + + struct DeletedCopyAssignClass + { + DeletedCopyAssignClass& + operator=(const DeletedCopyAssignClass&) = delete; + }; + + struct DeletedMoveAssignClass + { + DeletedMoveAssignClass& + operator=(DeletedMoveAssignClass&&) = delete; + }; #endif struct NType // neither trivial nor standard-layout @@ -450,6 +486,180 @@ namespace __gnu_test UnusualCopy(UnusualCopy&); }; } + + namespace assign + { + struct Empty {}; + + struct B { int i; B(){} }; + struct D : B {}; + + enum E { ee1 }; + enum E2 { ee2 }; + enum class SE { e1 }; + enum class SE2 { e2 }; + + enum OpE : int; + enum class OpSE : bool; + + union U { int i; Empty b; }; + + union UAssignAll + { + bool b; + char c; + template + void operator=(T&&); + }; + + union UDelAssignAll + { + bool b; + char c; + template + void operator=(T&&) = delete; + }; + + struct Abstract + { + virtual ~Abstract() = 0; + }; + + struct AbstractDelDtor + { + ~AbstractDelDtor() = delete; + virtual void foo() = 0; + }; + + struct Ukn; + + template + struct ImplicitTo + { + operator To(); + }; + + template + struct ExplicitTo + { + explicit operator To(); + }; + + template + struct DelImplicitTo + { + operator To() = delete; + }; + + template + struct DelExplicitTo + { + explicit operator To() = delete; + }; + + struct Ellipsis + { + Ellipsis(...){} + }; + + struct DelEllipsis + { + DelEllipsis(...) = delete; + }; + + struct Any + { + template + Any(T&&){} + }; + + struct nAny + { + template + nAny(T&&...){} + }; + + struct DelnAny + { + template + DelnAny(T&&...) = delete; + }; + + template + struct FromArgs + { + FromArgs(Args...); + }; + + template + struct DelFromArgs + { + DelFromArgs(Args...) = delete; + }; + + struct DelDef + { + DelDef() = delete; + }; + + struct DelCopy + { + DelCopy(const DelCopy&) = delete; + }; + + struct DelDtor + { + DelDtor() = default; + DelDtor(const DelDtor&) = default; + DelDtor(DelDtor&&) = default; + DelDtor(int); + DelDtor(int, B, U); + ~DelDtor() = delete; + }; + + struct Nontrivial + { + Nontrivial(); + Nontrivial(const Nontrivial&); + Nontrivial& operator=(const Nontrivial&); + ~Nontrivial(); + }; + + union NontrivialUnion + { + int i; + Nontrivial n; + }; + + struct UnusualCopy + { + UnusualCopy(UnusualCopy&); + }; + + struct AnyAssign + { + template + void operator=(T&&); + }; + + struct DelAnyAssign + { + template + void operator=(T&&) = delete; + }; + + struct DelCopyAssign + { + DelCopyAssign& operator=(const DelCopyAssign&) = delete; + DelCopyAssign& operator=(DelCopyAssign&&) = default; + }; + + struct MO + { + MO(MO&&) = default; + MO& operator=(MO&&) = default; + }; + } #endif } // namespace __gnu_test -- 2.30.2