From 6be2333a3345cc46e745db7280c1bfc2c1326018 Mon Sep 17 00:00:00 2001 From: paolo Date: Mon, 9 Apr 2007 17:07:37 +0000 Subject: [PATCH] 2007-04-09 Paolo Carlini * include/tr1/type_traits_fwd.h (__is_union_or_class): Remove. * include/tr1/type_traits (struct __in_array, struct __is_union_or_class, struct __is_union_or_class_helper, struct __is_empty_helper, struct __is_polymorphic_helper): Remove. (struct is_enum): Use __is_enum. (struct is_union): Use __is_union. (struct is_class): Use __is_class. (struct is_function): Adjust. (struct is_empty): Use __is_empty. (struct is_polymorphic): Use __is_polymorphic. (struct is_abstract): Use __is_abstract. (struct has_virtual_destructor): Use __has_virtual_destructor. (struct __is_base_of_helper): Use __is_base_of. * testsuite/tr1/4_metaprogramming/composite_type_traits/ is_union_or_class/typedefs.cc: Remove. * testsuite/tr1/4_metaprogramming/composite_type_traits/ is_union_or_class/is_union_or_class.cc: Likewise. * testsuite/tr1/4_metaprogramming/primary_type_categories/ is_class/typedefs.cc: New. * testsuite/tr1/4_metaprogramming/primary_type_categories/ is_class/is_class.cc: Likewise. * testsuite/tr1/4_metaprogramming/primary_type_categories/ is_union/typedefs.cc: Likewise. * testsuite/tr1/4_metaprogramming/primary_type_categories/ is_union/is_union.cc: Likewise. * testsuite/tr1/4_metaprogramming/type_properties/ has_virtual_destructor/typedefs.cc: Likewise. * testsuite/tr1/4_metaprogramming/type_properties/ has_virtual_destructor/has_virtual_destructor.cc: Likewise. * testsuite/util/testsuite_tr1.h (class VirtualDestructorClass): Add. * testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/ is_polymorphic.cc: Add test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123675 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 36 +++++ libstdc++-v3/include/tr1/type_traits | 159 ++++----------------- libstdc++-v3/include/tr1/type_traits_fwd.h | 6 +- .../is_union_or_class/is_union_or_class.cc | 62 -------- .../primary_type_categories/is_class/is_class.cc | 61 ++++++++ .../is_class}/typedefs.cc | 6 +- .../primary_type_categories/is_union/is_union.cc | 61 ++++++++ .../is_union}/typedefs.cc | 6 +- .../has_virtual_destructor.cc} | 30 ++-- .../has_virtual_destructor}/typedefs.cc | 6 +- .../is_polymorphic/is_polymorphic.cc | 3 +- libstdc++-v3/testsuite/util/testsuite_tr1.h | 9 +- 12 files changed, 223 insertions(+), 222 deletions(-) delete mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/is_union_or_class.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_class/is_class.cc copy libstdc++-v3/testsuite/tr1/4_metaprogramming/{composite_type_traits/is_union_or_class => primary_type_categories/is_class}/typedefs.cc (88%) create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_union/is_union.cc copy libstdc++-v3/testsuite/tr1/4_metaprogramming/{composite_type_traits/is_union_or_class => primary_type_categories/is_union}/typedefs.cc (88%) copy libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/{is_polymorphic/is_polymorphic.cc => has_virtual_destructor/has_virtual_destructor.cc} (51%) rename libstdc++-v3/testsuite/tr1/4_metaprogramming/{composite_type_traits/is_union_or_class => type_properties/has_virtual_destructor}/typedefs.cc (87%) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8785968d9fb..f180ad7c4b4 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,39 @@ +2007-04-09 Paolo Carlini + + * include/tr1/type_traits_fwd.h (__is_union_or_class): Remove. + * include/tr1/type_traits (struct __in_array, + struct __is_union_or_class, struct __is_union_or_class_helper, + struct __is_empty_helper, struct __is_polymorphic_helper): + Remove. + (struct is_enum): Use __is_enum. + (struct is_union): Use __is_union. + (struct is_class): Use __is_class. + (struct is_function): Adjust. + (struct is_empty): Use __is_empty. + (struct is_polymorphic): Use __is_polymorphic. + (struct is_abstract): Use __is_abstract. + (struct has_virtual_destructor): Use __has_virtual_destructor. + (struct __is_base_of_helper): Use __is_base_of. + * testsuite/tr1/4_metaprogramming/composite_type_traits/ + is_union_or_class/typedefs.cc: Remove. + * testsuite/tr1/4_metaprogramming/composite_type_traits/ + is_union_or_class/is_union_or_class.cc: Likewise. + * testsuite/tr1/4_metaprogramming/primary_type_categories/ + is_class/typedefs.cc: New. + * testsuite/tr1/4_metaprogramming/primary_type_categories/ + is_class/is_class.cc: Likewise. + * testsuite/tr1/4_metaprogramming/primary_type_categories/ + is_union/typedefs.cc: Likewise. + * testsuite/tr1/4_metaprogramming/primary_type_categories/ + is_union/is_union.cc: Likewise. + * testsuite/tr1/4_metaprogramming/type_properties/ + has_virtual_destructor/typedefs.cc: Likewise. + * testsuite/tr1/4_metaprogramming/type_properties/ + has_virtual_destructor/has_virtual_destructor.cc: Likewise. + * testsuite/util/testsuite_tr1.h (class VirtualDestructorClass): Add. + * testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/ + is_polymorphic.cc: Add test. + 2007-04-08 Alexey Beshenov PR libstdc++/31511 diff --git a/libstdc++-v3/include/tr1/type_traits b/libstdc++-v3/include/tr1/type_traits index 996ecf6fd93..c29701c8de0 100644 --- a/libstdc++-v3/include/tr1/type_traits +++ b/libstdc++-v3/include/tr1/type_traits @@ -1,6 +1,6 @@ // TR1 type_traits -*- C++ -*- -// Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007 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 @@ -42,27 +42,13 @@ namespace std { _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) - // For use in __in_array and elsewhere. + // For use in __is_convertible_simple. struct __sfinae_types { typedef char __one; typedef struct { char __arr[2]; } __two; }; - template - struct __in_array - : public __sfinae_types - { - private: - template - static __one __test(_Up(*)[1]); - template - static __two __test(...); - - public: - static const bool __value = sizeof(__test<_Tp>(0)) == 1; - }; - #define _DEFINE_SPEC_BODY(_Value) \ : public integral_constant { }; @@ -172,27 +158,27 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) template struct is_enum - : public integral_constant::value - || is_array<_Tp>::value - || is_pointer<_Tp>::value - || is_reference<_Tp>::value - || is_member_pointer<_Tp>::value - || is_function<_Tp>::value - || __is_union_or_class<_Tp>::value)> + : public integral_constant { }; - template - struct is_union { }; + template + struct is_union + : public integral_constant + { }; - template - struct is_class { }; + template + struct is_class + : public integral_constant + { }; template struct is_function - : public integral_constant::__value - || __is_union_or_class<_Tp>::value + : public integral_constant::value + || is_scalar<_Tp>::value + || is_array<_Tp>::value || is_reference<_Tp>::value - || is_void<_Tp>::value)> + || is_union<_Tp>::value + || is_class<_Tp>::value)> { }; /// @brief composite type traits [4.5.2]. @@ -234,26 +220,6 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) || is_member_function_pointer<_Tp>::value)> { }; - template - struct __is_union_or_class_helper - : public __sfinae_types - { - private: - template - static __one __test(int _Up::*); - template - static __two __test(...); - - public: - static const bool __value = sizeof(__test<_Tp>(0)) == 1; - }; - - // Extension. - template - struct __is_union_or_class - : public integral_constant::__value> - { }; - /// @brief type properties [4.5.3]. template struct is_const @@ -278,64 +244,20 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) remove_all_extents<_Tp>::type>::value)> { }; - // NB: Without compiler support we cannot tell union from class types, - // and is_empty and is_polymorphic don't work at all with the former. - template::value> - struct __is_empty_helper - { - private: - template - struct __first { }; - template - struct __second - : public _Up { }; - - public: - static const bool __value = sizeof(__first<_Tp>) == sizeof(__second<_Tp>); - }; - - template - struct __is_empty_helper<_Tp, true> - { static const bool __value = false; }; - template struct is_empty - : public integral_constant::__value> + : public integral_constant { }; - template::value> - struct __is_polymorphic_helper - { - private: - template - struct __first - : public _Up { }; - template - struct __second - : public _Up - { - virtual void __dummy(); - virtual ~__second() throw(); - }; - - public: - static const bool __value = sizeof(__first<_Tp>) == sizeof(__second<_Tp>); - }; - - template - struct __is_polymorphic_helper<_Tp, true> - { static const bool __value = false; }; - template struct is_polymorphic - : public integral_constant::__value> + : public integral_constant { }; - // Exploit the resolution DR core/337. template struct is_abstract - : public integral_constant::__value - && __is_union_or_class<_Tp>::value)> { }; + : public integral_constant + { }; template struct has_trivial_constructor @@ -365,9 +287,10 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) struct has_nothrow_assign : public integral_constant::value> { }; - template + template struct has_virtual_destructor - : public false_type { }; + : public integral_constant + { }; template struct is_signed @@ -430,37 +353,17 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) struct is_same<_Tp, _Tp> : public true_type { }; - // See Daveed Vandevoorde explanation in http://tinyurl.com/502f. - // Also see Rani Sharoni in http://tinyurl.com/6jvyq. - template::value - || !__is_union_or_class<_Derived>::value - || is_same<_Base, _Derived>::value)> + template struct __is_base_of_helper - : public __sfinae_types { - private: - typedef typename remove_cv<_Base>::type _NoCv_Base; - typedef typename remove_cv<_Derived>::type _NoCv_Derived; - - template - static __one __test(_NoCv_Derived&, _Up); - static __two __test(_NoCv_Base&, int); - - struct _Conv - { - operator _NoCv_Derived&(); - operator _NoCv_Base&() const; - }; - - public: - static const bool __value = sizeof(__test(_Conv(), 0)) == 1; + typedef typename remove_cv<_Base>::type _NoCv_Base; + typedef typename remove_cv<_Derived>::type _NoCv_Derived; + static const bool __value = (is_same<_Base, _Derived>::value + || (__is_base_of(_Base, _Derived) + && !is_same<_NoCv_Base, + _NoCv_Derived>::value)); }; - - template - struct __is_base_of_helper<_Base, _Derived, true> - { static const bool __value = is_same<_Base, _Derived>::value; }; - + template struct is_base_of : public integral_constant struct is_member_pointer; - // Extension. - template - struct __is_union_or_class; - /// @brief type properties [4.5.3]. template struct is_const; diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/is_union_or_class.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/is_union_or_class.cc deleted file mode 100644 index 82c727d1ce8..00000000000 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/is_union_or_class.cc +++ /dev/null @@ -1,62 +0,0 @@ -// 2005-02-25 Paolo Carlini -// -// Copyright (C) 2005 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 2, 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 COPYING. If not, write to the Free -// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -// USA. - -// 4.5.2 Composite type traits - -#include -#include -#include - -void test01() -{ - bool test __attribute__((unused)) = true; - using std::tr1::__is_union_or_class; - using namespace __gnu_test; - - // Positive tests. - VERIFY( (test_category<__is_union_or_class, UnionType>(true)) ); - VERIFY( (test_category<__is_union_or_class, ClassType>(true)) ); - VERIFY( (test_category<__is_union_or_class, DerivedType>(true)) ); - VERIFY( (test_category<__is_union_or_class, ConvType>(true)) ); - VERIFY( (test_category<__is_union_or_class, AbstractClass>(true)) ); - VERIFY( (test_category<__is_union_or_class, PolymorphicClass>(true)) ); - VERIFY( (test_category<__is_union_or_class, DerivedPolymorphic>(true)) ); - - // Negative tests. - VERIFY( (test_category<__is_union_or_class, void>(false)) ); - VERIFY( (test_category<__is_union_or_class, int>(false)) ); - VERIFY( (test_category<__is_union_or_class, float>(false)) ); - VERIFY( (test_category<__is_union_or_class, int[2]>(false)) ); - VERIFY( (test_category<__is_union_or_class, int*>(false)) ); - VERIFY( (test_category<__is_union_or_class, int(*)(int)>(false)) ); - VERIFY( (test_category<__is_union_or_class, float&>(false)) ); - VERIFY( (test_category<__is_union_or_class, float(&)(float)>(false)) ); - VERIFY( (test_category<__is_union_or_class, int (ClassType::*)>(false)) ); - VERIFY( (test_category<__is_union_or_class, - int (ClassType::*) (int)>(false)) ); - VERIFY( (test_category<__is_union_or_class, int (int)>(false)) ); - VERIFY( (test_category<__is_union_or_class, EnumType>(false)) ); -} - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_class/is_class.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_class/is_class.cc new file mode 100644 index 00000000000..5e88fb5b6d5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_class/is_class.cc @@ -0,0 +1,61 @@ +// 2007-04-08 Paolo Carlini +// +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_class; + 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)) ); + + // 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_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/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_class/typedefs.cc similarity index 88% copy from libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/typedefs.cc copy to libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_class/typedefs.cc index 65c84e03aab..8ad546ac3b6 100644 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/typedefs.cc +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_class/typedefs.cc @@ -1,6 +1,6 @@ -// 2005-02-25 Paolo Carlini +// 2007-04-08 Paolo Carlini // -// Copyright (C) 2005 Free Software Foundation, Inc. +// Copyright (C) 2007 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,7 +28,7 @@ void test01() { // Check for required typedefs - typedef std::tr1::__is_union_or_class test_type; + typedef std::tr1::is_class 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/tr1/4_metaprogramming/primary_type_categories/is_union/is_union.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_union/is_union.cc new file mode 100644 index 00000000000..e381f888b27 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_union/is_union.cc @@ -0,0 +1,61 @@ +// 2007-04-08 Paolo Carlini +// +// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +// USA. + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_union; + using namespace __gnu_test; + + // Positive tests. + 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)) ); + 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_category(false)) ); + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_union/typedefs.cc similarity index 88% copy from libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/typedefs.cc copy to libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_union/typedefs.cc index 65c84e03aab..9f24c5e9786 100644 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/typedefs.cc +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_union/typedefs.cc @@ -1,6 +1,6 @@ -// 2005-02-25 Paolo Carlini +// 2007-04-08 Paolo Carlini // -// Copyright (C) 2005 Free Software Foundation, Inc. +// Copyright (C) 2007 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,7 +28,7 @@ void test01() { // Check for required typedefs - typedef std::tr1::__is_union_or_class test_type; + typedef std::tr1::is_union 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/tr1/4_metaprogramming/type_properties/is_polymorphic/is_polymorphic.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_virtual_destructor/has_virtual_destructor.cc similarity index 51% copy from libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/is_polymorphic.cc copy to libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_virtual_destructor/has_virtual_destructor.cc index 6a5efa046f9..910aeded2d5 100644 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/is_polymorphic.cc +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_virtual_destructor/has_virtual_destructor.cc @@ -1,6 +1,6 @@ -// 2005-03-03 Paolo Carlini +// 2007-04-08 Paolo Carlini // -// Copyright (C) 2005 Free Software Foundation, Inc. +// Copyright (C) 2007 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,23 +28,25 @@ void test01() { bool test __attribute__((unused)) = true; - using std::tr1::is_polymorphic; + using std::tr1::has_virtual_destructor; 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)) ); // 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_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); } int main() diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_virtual_destructor/typedefs.cc similarity index 87% rename from libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/typedefs.cc rename to libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_virtual_destructor/typedefs.cc index 65c84e03aab..94d81eafb21 100644 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/typedefs.cc +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_virtual_destructor/typedefs.cc @@ -1,6 +1,6 @@ -// 2005-02-25 Paolo Carlini +// 2007-04-08 Paolo Carlini // -// Copyright (C) 2005 Free Software Foundation, Inc. +// Copyright (C) 2007 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,7 +28,7 @@ void test01() { // Check for required typedefs - typedef std::tr1::__is_union_or_class test_type; + typedef std::tr1::has_virtual_destructor 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/tr1/4_metaprogramming/type_properties/is_polymorphic/is_polymorphic.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/is_polymorphic.cc index 6a5efa046f9..6dc5c1c2c6d 100644 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/is_polymorphic.cc +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/is_polymorphic.cc @@ -1,6 +1,6 @@ // 2005-03-03 Paolo Carlini // -// Copyright (C) 2005 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007 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 @@ -35,6 +35,7 @@ void test01() VERIFY( (test_category(true)) ); VERIFY( (test_category(true)) ); VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); VERIFY( (test_category(true)) ); VERIFY( (test_category(true)) ); diff --git a/libstdc++-v3/testsuite/util/testsuite_tr1.h b/libstdc++-v3/testsuite/util/testsuite_tr1.h index b48f1a36b41..8b630bb23e9 100644 --- a/libstdc++-v3/testsuite/util/testsuite_tr1.h +++ b/libstdc++-v3/testsuite/util/testsuite_tr1.h @@ -1,7 +1,7 @@ // -*- C++ -*- // Testing utilities for the tr1 testsuite. // -// Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006, 2007 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 @@ -103,17 +103,20 @@ namespace __gnu_test class AbstractClass { virtual void rotate(int) = 0; - virtual ~AbstractClass(); }; class PolymorphicClass { virtual void rotate(int); - virtual ~PolymorphicClass(); }; class DerivedPolymorphic : public PolymorphicClass { }; + class VirtualDestructorClass + { + virtual ~VirtualDestructorClass(); + }; + union UnionType { }; class IncompleteClass; -- 2.11.4.GIT