From 65cee9bdb7b5975151802bd805ba720f540dec8d Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 19 Apr 2011 00:10:53 +0000 Subject: [PATCH] type_traits (is_nothrow_default_constructible, [...]): Add. 2011-04-18 Paolo Carlini * include/std/type_traits (is_nothrow_default_constructible, is_nothrow_copy_constructible, is_nothrow_move_constructible, is_copy_constructible, is_move_constructible): Add. (has_nothrow_default_constructor, has_nothrow_copy_constructor): Remove. (is_nothrow_constructible): Adjust. * testsuite/util/testsuite_tr1.h (ThrowDefaultClass, ThrowCopyConsClass, ThrowMoveConsClass, NoexceptDefaultClass, ExceptDefaultClass, NoexceptCopyConsClass, ExceptCopyConsClass, NoexceptMoveConsClass, ExceptMoveConsClass): Add in C++0x mode. * testsuite/20_util/has_nothrow_default_constructor: Remove. * testsuite/20_util/has_nothrow_copy_constructor: Likewise. * testsuite/20_util/is_nothrow_move_constructible/value.cc: Likewise. * testsuite/20_util/is_nothrow_move_constructible/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_nothrow_move_constructible/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_nothrow_copy_constructible/value.cc: Likewise. * testsuite/20_util/is_nothrow_copy_constructible/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_nothrow_copy_constructible/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_nothrow_default_constructible/value.cc: Likewise. * testsuite/20_util/is_nothrow_default_constructible/requirements/ typedefs.cc: Likewise. * testsuite/20_util/is_nothrow_default_constructible/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_move_constructible/value.cc: Likewise. * testsuite/20_util/is_move_constructible/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_move_constructible/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_copy_constructible/value.cc: Likewise. * testsuite/20_util/is_copy_constructible/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_copy_constructible/requirements/ explicit_instantiation.cc: Likewise. * testsuite/20_util/is_default_constructible/value.cc: Add tests. * testsuite/20_util/is_nothrow_constructible/value.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: r172684 --- libstdc++-v3/ChangeLog | 53 +++++++ libstdc++-v3/include/std/type_traits | 147 ++++++++++++++---- .../20_util/declval/requirements/1_neg.cc | 2 +- .../has_nothrow_copy_constructor/value.cc | 56 ------- .../has_nothrow_default_constructor/value.cc | 61 -------- .../requirements/explicit_instantiation.cc | 29 ++++ .../requirements/typedefs.cc | 34 ++++ .../20_util/is_copy_constructible/value.cc | 73 +++++++++ .../20_util/is_default_constructible/value.cc | 7 + .../requirements/explicit_instantiation.cc | 29 ++++ .../requirements/typedefs.cc | 34 ++++ .../20_util/is_move_constructible/value.cc | 73 +++++++++ .../20_util/is_nothrow_constructible/value.cc | 6 +- .../requirements/explicit_instantiation.cc | 5 +- .../requirements/typedefs.cc | 12 +- .../is_nothrow_copy_constructible/value.cc | 74 +++++++++ .../requirements/explicit_instantiation.cc | 5 +- .../requirements/typedefs.cc | 12 +- .../is_nothrow_default_constructible/value.cc | 74 +++++++++ .../requirements/explicit_instantiation.cc | 29 ++++ .../requirements/typedefs.cc | 34 ++++ .../is_nothrow_move_constructible/value.cc | 73 +++++++++ .../make_signed/requirements/typedefs_neg.cc | 4 +- .../requirements/typedefs_neg.cc | 4 +- libstdc++-v3/testsuite/util/testsuite_tr1.h | 45 ++++++ 25 files changed, 804 insertions(+), 171 deletions(-) delete mode 100644 libstdc++-v3/testsuite/20_util/has_nothrow_copy_constructor/value.cc delete mode 100644 libstdc++-v3/testsuite/20_util/has_nothrow_default_constructor/value.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_copy_constructible/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_copy_constructible/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_move_constructible/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_move_constructible/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc rename libstdc++-v3/testsuite/20_util/{has_nothrow_copy_constructor => is_nothrow_copy_constructible}/requirements/explicit_instantiation.cc (88%) rename libstdc++-v3/testsuite/20_util/{has_nothrow_copy_constructor => is_nothrow_copy_constructible}/requirements/typedefs.cc (71%) create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc rename libstdc++-v3/testsuite/20_util/{has_nothrow_default_constructor => is_nothrow_default_constructible}/requirements/explicit_instantiation.cc (88%) rename libstdc++-v3/testsuite/20_util/{has_nothrow_default_constructor => is_nothrow_default_constructible}/requirements/typedefs.cc (71%) create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/value.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index dd2b05332b8..6eaa0264669 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,56 @@ +2011-04-18 Paolo Carlini + + * include/std/type_traits (is_nothrow_default_constructible, + is_nothrow_copy_constructible, is_nothrow_move_constructible, + is_copy_constructible, is_move_constructible): Add. + (has_nothrow_default_constructor, has_nothrow_copy_constructor): + Remove. + (is_nothrow_constructible): Adjust. + + * testsuite/util/testsuite_tr1.h (ThrowDefaultClass, + ThrowCopyConsClass, ThrowMoveConsClass, NoexceptDefaultClass, + ExceptDefaultClass, NoexceptCopyConsClass, ExceptCopyConsClass, + NoexceptMoveConsClass, ExceptMoveConsClass): Add in C++0x mode. + + * testsuite/20_util/has_nothrow_default_constructor: Remove. + * testsuite/20_util/has_nothrow_copy_constructor: Likewise. + + * testsuite/20_util/is_nothrow_move_constructible/value.cc: Likewise. + * testsuite/20_util/is_nothrow_move_constructible/requirements/ + typedefs.cc: Likewise. + * testsuite/20_util/is_nothrow_move_constructible/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/is_nothrow_copy_constructible/value.cc: Likewise. + * testsuite/20_util/is_nothrow_copy_constructible/requirements/ + typedefs.cc: Likewise. + * testsuite/20_util/is_nothrow_copy_constructible/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/is_nothrow_default_constructible/value.cc: + Likewise. + * testsuite/20_util/is_nothrow_default_constructible/requirements/ + typedefs.cc: Likewise. + * testsuite/20_util/is_nothrow_default_constructible/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/is_move_constructible/value.cc: Likewise. + * testsuite/20_util/is_move_constructible/requirements/typedefs.cc: + Likewise. + * testsuite/20_util/is_move_constructible/requirements/ + explicit_instantiation.cc: Likewise. + * testsuite/20_util/is_copy_constructible/value.cc: Likewise. + * testsuite/20_util/is_copy_constructible/requirements/typedefs.cc: + Likewise. + * testsuite/20_util/is_copy_constructible/requirements/ + explicit_instantiation.cc: Likewise. + + * testsuite/20_util/is_default_constructible/value.cc: Add tests. + * testsuite/20_util/is_nothrow_constructible/value.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-04-17 Paolo Carlini * testsuite/25_algorithms/partition/moveable.cc: Actually run diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index a4c76730f5b..ef622988aa4 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -854,27 +854,132 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Args...>::value)> { }; + template::value> + struct __is_copy_constructible_impl; - template - struct __is_nt_constructible_helper - { static const bool __value = false; }; + template + struct __is_copy_constructible_impl<_Tp, true> + : public false_type { }; + + template + struct __is_copy_constructible_impl<_Tp, false> + : public is_constructible<_Tp, const _Tp&> + { }; + + /// is_copy_constructible + template + struct is_copy_constructible + : public __is_copy_constructible_impl<_Tp> + { }; + + template::value> + struct __is_move_constructible_impl; + + template + struct __is_move_constructible_impl<_Tp, true> + : public false_type { }; + + template + struct __is_move_constructible_impl<_Tp, false> + : public is_constructible<_Tp, _Tp&&> + { }; + + /// is_move_constructible + template + struct is_move_constructible + : public __is_move_constructible_impl<_Tp> + { }; + + template + struct __is_nt_default_constructible_atom + : public integral_constant + { }; + + template::value> + struct __is_nt_default_constructible_impl; + + template + struct __is_nt_default_constructible_impl<_Tp, true> + : public __and_<__is_array_known_bounds<_Tp>, + __is_nt_default_constructible_atom::type>>::type + { }; + + template + struct __is_nt_default_constructible_impl<_Tp, false> + : public __is_nt_default_constructible_atom<_Tp> + { }; + + /// is_nothrow_default_constructible + template + struct is_nothrow_default_constructible + : public __and_, + __is_nt_default_constructible_impl<_Tp>>::type + { }; template - struct __is_nt_constructible_helper - { static const bool __value = noexcept(_Tp(declval<_Args>()...)); }; + struct __is_nt_constructible_impl + : public integral_constant()...))> + { }; template - struct __is_nt_constructible_helper - { - static const bool __value = noexcept(static_cast<_Tp>(declval<_Arg>())); - }; + struct __is_nt_constructible_impl<_Tp, _Arg> + : public integral_constant(declval<_Arg>()))> + { }; + + template + struct __is_nt_constructible_impl<_Tp> + : public is_nothrow_default_constructible<_Tp> + { }; /// is_nothrow_constructible template struct is_nothrow_constructible - : public integral_constant::value, - _Tp, _Args...>::__value> + : public __and_, + __is_nt_constructible_impl<_Tp, _Args...>>::type + { }; + + template::value> + struct __is_nothrow_copy_constructible_impl; + + template + struct __is_nothrow_copy_constructible_impl<_Tp, true> + : public false_type { }; + + template + struct __is_nothrow_copy_constructible_impl<_Tp, false> + : public is_nothrow_constructible<_Tp, const _Tp&> + { }; + + /// is_nothrow_copy_constructible + template + struct is_nothrow_copy_constructible + : public __is_nothrow_copy_constructible_impl<_Tp> + { }; + + template::value> + struct __is_nothrow_move_constructible_impl; + + template + struct __is_nothrow_move_constructible_impl<_Tp, true> + : public false_type { }; + + template + struct __is_nothrow_move_constructible_impl<_Tp, false> + : public is_nothrow_constructible<_Tp, _Tp&&> + { }; + + /// is_nothrow_move_constructible + template + struct is_nothrow_move_constructible + : public __is_nothrow_move_constructible_impl<_Tp> + { }; + + /// has_nothrow_copy_assign + template + struct has_nothrow_copy_assign + : public integral_constant { }; /// has_trivial_default_constructor @@ -901,24 +1006,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public integral_constant { }; - /// has_nothrow_default_constructor - template - struct has_nothrow_default_constructor - : public integral_constant - { }; - - /// has_nothrow_copy_constructor - template - struct has_nothrow_copy_constructor - : public integral_constant - { }; - - /// has_nothrow_copy_assign - template - struct has_nothrow_copy_assign - : public integral_constant - { }; - /// has_virtual_destructor template struct has_virtual_destructor 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 aaf1fb029db..6aee07a3dee 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 *-*-* } 1523 } +// { dg-error "static assertion failed" "" { target *-*-* } 1610 } #include diff --git a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_constructor/value.cc b/libstdc++-v3/testsuite/20_util/has_nothrow_copy_constructor/value.cc deleted file mode 100644 index 963c7bd57a5..00000000000 --- a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_constructor/value.cc +++ /dev/null @@ -1,56 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2004-12-30 Paolo Carlini -// -// Copyright (C) 2004, 2005, 2007, 2009 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_constructor; - using namespace __gnu_test; - - // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - - // Negative tests. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/20_util/has_nothrow_default_constructor/value.cc b/libstdc++-v3/testsuite/20_util/has_nothrow_default_constructor/value.cc deleted file mode 100644 index 01548211c40..00000000000 --- a/libstdc++-v3/testsuite/20_util/has_nothrow_default_constructor/value.cc +++ /dev/null @@ -1,61 +0,0 @@ -// { dg-options "-std=gnu++0x" } -// 2004-12-29 Paolo Carlini -// -// Copyright (C) 2004, 2005, 2006, 2007, 2009 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 -// . - -// 4.5.3 Type properties - -#include -#include -#include - -void test01() -{ - bool test __attribute__((unused)) = true; - using std::has_nothrow_default_constructor; - using namespace __gnu_test; - - // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - - // Negative tests. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/20_util/is_copy_constructible/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_copy_constructible/requirements/explicit_instantiation.cc new file mode 100644 index 00000000000..4ff9d10251d --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_copy_constructible/requirements/explicit_instantiation.cc @@ -0,0 +1,29 @@ +// { 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 +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_copy_constructible; +} diff --git a/libstdc++-v3/testsuite/20_util/is_copy_constructible/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_copy_constructible/requirements/typedefs.cc new file mode 100644 index 00000000000..840a9f156da --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_copy_constructible/requirements/typedefs.cc @@ -0,0 +1,34 @@ +// { 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 +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +void test01() +{ + // Check for required typedefs + typedef std::is_copy_constructible 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_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc new file mode 100644 index 00000000000..d1c2ea6425d --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc @@ -0,0 +1,73 @@ +// { dg-options "-std=gnu++0x" } +// +// 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_constructible; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + // Negative tests. + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + VERIFY( (test_property(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/is_default_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_default_constructible/value.cc index bd18d50482d..6461cb7d5fe 100644 --- a/libstdc++-v3/testsuite/20_util/is_default_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_default_constructible/value.cc @@ -93,6 +93,13 @@ static_assert(std::is_default_constructible< static_assert(std::is_default_constructible[1]>::value, "Error"); +static_assert(std::is_default_constructible + <__gnu_test::NoexceptDefaultClass>::value, "Error"); +static_assert(std::is_default_constructible + <__gnu_test::ThrowDefaultClass>::value, "Error"); +static_assert(std::is_default_constructible + <__gnu_test::ExceptDefaultClass>::value, "Error"); + static_assert(!std::is_default_constructible::value, "Error"); static_assert(!std::is_default_constructible::value, "Error"); static_assert(!std::is_default_constructible::value, "Error"); diff --git a/libstdc++-v3/testsuite/20_util/is_move_constructible/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_move_constructible/requirements/explicit_instantiation.cc new file mode 100644 index 00000000000..2d67b20767d --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_move_constructible/requirements/explicit_instantiation.cc @@ -0,0 +1,29 @@ +// { 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 +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_move_constructible; +} diff --git a/libstdc++-v3/testsuite/20_util/is_move_constructible/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_move_constructible/requirements/typedefs.cc new file mode 100644 index 00000000000..76208d8ba10 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_move_constructible/requirements/typedefs.cc @@ -0,0 +1,34 @@ +// { 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 +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +void test01() +{ + // Check for required typedefs + typedef std::is_move_constructible 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_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc new file mode 100644 index 00000000000..623359a461e --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc @@ -0,0 +1,73 @@ +// { dg-options "-std=gnu++0x" } +// +// 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_constructible; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + // Negative tests. + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_constructible/value.cc index b3246fad119..a77fa6c8b99 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_constructible/value.cc @@ -2,7 +2,7 @@ // 2010-06-09 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 @@ -43,6 +43,8 @@ void test01() VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + // Negative tests. VERIFY( (test_property(false)) ); @@ -69,6 +71,8 @@ void test01() int&>(false)) ); VERIFY( (test_property(false)) ); + + VERIFY( (test_property(false)) ); } int main() diff --git a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_constructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/requirements/explicit_instantiation.cc similarity index 88% rename from libstdc++-v3/testsuite/20_util/has_nothrow_copy_constructor/requirements/explicit_instantiation.cc rename to libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/requirements/explicit_instantiation.cc index 7c844515090..39ab86b6641 100644 --- a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_constructor/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/requirements/explicit_instantiation.cc @@ -2,7 +2,7 @@ // { dg-do compile } // 2007-04-30 Benjamin Kosnik -// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2007, 2009, 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 @@ -19,7 +19,6 @@ // with this library; see the file COPYING3. If not see // . - // NB: This file is for testing type_traits with NO OTHER INCLUDES. #include @@ -27,5 +26,5 @@ namespace std { typedef short test_type; - template struct has_nothrow_copy_constructor; + template struct is_nothrow_copy_constructible; } diff --git a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_constructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/requirements/typedefs.cc similarity index 71% rename from libstdc++-v3/testsuite/20_util/has_nothrow_copy_constructor/requirements/typedefs.cc rename to libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/requirements/typedefs.cc index 5c40837aa62..320010b1c48 100644 --- a/libstdc++-v3/testsuite/20_util/has_nothrow_copy_constructor/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/requirements/typedefs.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++0x" } // 2004-12-30 Paolo Carlini // -// Copyright (C) 2004, 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2004, 2007, 2009, 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 @@ -28,9 +28,9 @@ void test01() { // Check for required typedefs - typedef std::has_nothrow_copy_constructor 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; + typedef std::is_nothrow_copy_constructible 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_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc new file mode 100644 index 00000000000..2c279967cc1 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc @@ -0,0 +1,74 @@ +// { dg-options "-std=gnu++0x" } +// 2004-12-30 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2007, 2009, 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_constructible; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + // Negative tests. + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(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/has_nothrow_default_constructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/requirements/explicit_instantiation.cc similarity index 88% rename from libstdc++-v3/testsuite/20_util/has_nothrow_default_constructor/requirements/explicit_instantiation.cc rename to libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/requirements/explicit_instantiation.cc index dec9b965e81..2c7e2df5e5e 100644 --- a/libstdc++-v3/testsuite/20_util/has_nothrow_default_constructor/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/requirements/explicit_instantiation.cc @@ -2,7 +2,7 @@ // { dg-do compile } // 2007-04-30 Benjamin Kosnik -// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2007, 2009, 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 @@ -19,7 +19,6 @@ // with this library; see the file COPYING3. If not see // . - // NB: This file is for testing type_traits with NO OTHER INCLUDES. #include @@ -27,5 +26,5 @@ namespace std { typedef short test_type; - template struct has_nothrow_default_constructor; + template struct is_nothrow_default_constructible; } diff --git a/libstdc++-v3/testsuite/20_util/has_nothrow_default_constructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/requirements/typedefs.cc similarity index 71% rename from libstdc++-v3/testsuite/20_util/has_nothrow_default_constructor/requirements/typedefs.cc rename to libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/requirements/typedefs.cc index 709fff331f5..0c0fd6426d0 100644 --- a/libstdc++-v3/testsuite/20_util/has_nothrow_default_constructor/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/requirements/typedefs.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++0x" } // 2004-12-29 Paolo Carlini // -// Copyright (C) 2004, 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2004, 2007, 2009, 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 @@ -28,9 +28,9 @@ void test01() { // Check for required typedefs - typedef std::has_nothrow_default_constructor 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; + typedef std::is_nothrow_default_constructible 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_default_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/value.cc new file mode 100644 index 00000000000..d806cf1cf03 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/value.cc @@ -0,0 +1,74 @@ +// { dg-options "-std=gnu++0x" } +// 2004-12-29 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009, 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_default_constructible; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + VERIFY( (test_category(true)) ); + + // Negative tests. + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/requirements/explicit_instantiation.cc new file mode 100644 index 00000000000..bca081b2302 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/requirements/explicit_instantiation.cc @@ -0,0 +1,29 @@ +// { 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 +// . + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + typedef short test_type; + template struct is_nothrow_move_constructible; +} diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/requirements/typedefs.cc new file mode 100644 index 00000000000..13a0e3ee8d4 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/requirements/typedefs.cc @@ -0,0 +1,34 @@ +// { 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 +// . + +// +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +void test01() +{ + // Check for required typedefs + typedef std::is_nothrow_move_constructible 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_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc new file mode 100644 index 00000000000..b154f787a3b --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc @@ -0,0 +1,73 @@ +// { dg-options "-std=gnu++0x" } +// +// 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_constructible; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + VERIFY( (test_property(true)) ); + + // Negative tests. + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(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 4a568e363e8..871bbe571e7 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 *-*-* } 1302 } -// { dg-error "declaration of" "" { target *-*-* } 1266 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1389 } +// { dg-error "declaration of" "" { target *-*-* } 1353 } 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 955c1ce00f2..edcce7cf0f5 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 *-*-* } 1226 } -// { dg-error "declaration of" "" { target *-*-* } 1190 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1313 } +// { dg-error "declaration of" "" { target *-*-* } 1277 } diff --git a/libstdc++-v3/testsuite/util/testsuite_tr1.h b/libstdc++-v3/testsuite/util/testsuite_tr1.h index 7e36ee3f5fe..9265bc41216 100644 --- a/libstdc++-v3/testsuite/util/testsuite_tr1.h +++ b/libstdc++-v3/testsuite/util/testsuite_tr1.h @@ -145,7 +145,22 @@ namespace __gnu_test ThrowExplicitClass(double&, int&, double&) throw(int); }; + struct ThrowDefaultClass + { + ThrowDefaultClass() throw(int); + }; + + struct ThrowCopyConsClass + { + ThrowCopyConsClass(const ThrowCopyConsClass&) throw(int); + }; + #ifdef __GXX_EXPERIMENTAL_CXX0X__ + struct ThrowMoveConsClass + { + ThrowMoveConsClass(ThrowMoveConsClass&&) throw(int); + }; + struct NoexceptExplicitClass { NoexceptExplicitClass(double&) noexcept(true); @@ -159,6 +174,36 @@ namespace __gnu_test explicit ExceptExplicitClass(int&) noexcept(false); ExceptExplicitClass(double&, int&, double&) noexcept(false); }; + + struct NoexceptDefaultClass + { + NoexceptDefaultClass() noexcept(true); + }; + + struct ExceptDefaultClass + { + ExceptDefaultClass() noexcept(false); + }; + + struct NoexceptCopyConsClass + { + NoexceptCopyConsClass(const NoexceptCopyConsClass&) noexcept(true); + }; + + struct ExceptCopyConsClass + { + ExceptCopyConsClass(const ExceptCopyConsClass&) noexcept(false); + }; + + struct NoexceptMoveConsClass + { + NoexceptMoveConsClass(NoexceptMoveConsClass&&) noexcept(true); + }; + + struct ExceptMoveConsClass + { + ExceptMoveConsClass(ExceptMoveConsClass&&) noexcept(false); + }; #endif struct NType // neither trivial nor standard-layout -- 2.30.2