From a2e0c99d53b5e387ebf7765a372be1dcf835dc4e Mon Sep 17 00:00:00 2001 From: paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed, 27 Apr 2005 15:08:57 +0000 Subject: [PATCH] 2005-04-27 Paolo Carlini <pcarlini@suse.de> * include/tr1/type_traits (has_trivial_copy, has_trivial_assign, has_nothrow_copy, has_nothrow_assign): Adjust according to the resolution of TR1 issue 3.21. * testsuite/testsuite_tr1.h (test_copy_property, test_assign_property): Remove. * testsuite/tr1/4_metaprogramming/type_properties/ has_nothrow_assign/has_nothrow_assign.cc: Adjust. * testsuite/tr1/4_metaprogramming/type_properties/ has_nothrow_copy/has_nothrow_copy.cc: Likewise. * testsuite/tr1/4_metaprogramming/type_properties/ has_trivial_assign/has_trivial_assign.cc: Likewise. * testsuite/tr1/4_metaprogramming/type_properties/ has_trivial_copy/has_trivial_copy.cc: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98829 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 16 +++++++++ libstdc++-v3/include/tr1/type_traits | 14 +++----- libstdc++-v3/testsuite/testsuite_tr1.h | 34 ------------------- .../has_nothrow_assign/has_nothrow_assign.cc | 34 +++++++++---------- .../has_nothrow_copy/has_nothrow_copy.cc | 34 +++++++++---------- .../has_trivial_assign/has_trivial_assign.cc | 34 +++++++++---------- .../has_trivial_copy/has_trivial_copy.cc | 34 +++++++++---------- 7 files changed, 84 insertions(+), 116 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8aa4ecc7a8d..ccb473e462c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,19 @@ +2005-04-27 Paolo Carlini <pcarlini@suse.de> + + * include/tr1/type_traits (has_trivial_copy, has_trivial_assign, + has_nothrow_copy, has_nothrow_assign): Adjust according to the + resolution of TR1 issue 3.21. + * testsuite/testsuite_tr1.h (test_copy_property, + test_assign_property): Remove. + * testsuite/tr1/4_metaprogramming/type_properties/ + has_nothrow_assign/has_nothrow_assign.cc: Adjust. + * testsuite/tr1/4_metaprogramming/type_properties/ + has_nothrow_copy/has_nothrow_copy.cc: Likewise. + * testsuite/tr1/4_metaprogramming/type_properties/ + has_trivial_assign/has_trivial_assign.cc: Likewise. + * testsuite/tr1/4_metaprogramming/type_properties/ + has_trivial_copy/has_trivial_copy.cc: Likewise. + 2005-04-26 Jones Desougi <jones@ingate.com> PR libstdc++/21131 diff --git a/libstdc++-v3/include/tr1/type_traits b/libstdc++-v3/include/tr1/type_traits index 55f585f9f4b..0bd05bb1198 100644 --- a/libstdc++-v3/include/tr1/type_traits +++ b/libstdc++-v3/include/tr1/type_traits @@ -366,14 +366,11 @@ namespace tr1 template<typename _Tp> struct has_trivial_copy - : public integral_constant<bool, (is_pod<_Tp>::value - && !is_volatile<_Tp>::value)> { }; + : public integral_constant<bool, is_pod<_Tp>::value> { }; template<typename _Tp> struct has_trivial_assign - : public integral_constant<bool, (is_pod<_Tp>::value - && !is_const<_Tp>::value - && !is_volatile<_Tp>::value)> { }; + : public integral_constant<bool, is_pod<_Tp>::value> { }; template<typename _Tp> struct has_trivial_destructor @@ -385,14 +382,11 @@ namespace tr1 template<typename _Tp> struct has_nothrow_copy - : public integral_constant<bool, (is_pod<_Tp>::value - && !is_volatile<_Tp>::value)> { }; + : public integral_constant<bool, is_pod<_Tp>::value> { }; template<typename _Tp> struct has_nothrow_assign - : public integral_constant<bool, (is_pod<_Tp>::value - && !is_const<_Tp>::value - && !is_volatile<_Tp>::value)> { }; + : public integral_constant<bool, is_pod<_Tp>::value> { }; template<typename> struct has_virtual_destructor diff --git a/libstdc++-v3/testsuite/testsuite_tr1.h b/libstdc++-v3/testsuite/testsuite_tr1.h index ea6affb37c1..ff0a3cefce3 100644 --- a/libstdc++-v3/testsuite/testsuite_tr1.h +++ b/libstdc++-v3/testsuite/testsuite_tr1.h @@ -62,40 +62,6 @@ namespace __gnu_test return ret; } - template<template<typename> class Property, - typename Type> - bool - test_copy_property(bool value) - { - bool ret = true; - ret &= Property<Type>::value == value; - ret &= Property<const Type>::value == value; - ret &= Property<volatile Type>::value == !value; - ret &= Property<const volatile Type>::value == !value; - ret &= Property<Type>::type::value == value; - ret &= Property<const Type>::type::value == value; - ret &= Property<volatile Type>::type::value == !value; - ret &= Property<const volatile Type>::type::value == !value; - return ret; - } - - template<template<typename> class Property, - typename Type> - bool - test_assign_property(bool value) - { - bool ret = true; - ret &= Property<Type>::value == value; - ret &= Property<const Type>::value == !value; - ret &= Property<volatile Type>::value == !value; - ret &= Property<const volatile Type>::value == !value; - ret &= Property<Type>::type::value == value; - ret &= Property<const Type>::type::value == !value; - ret &= Property<volatile Type>::type::value == !value; - ret &= Property<const volatile Type>::type::value == !value; - return ret; - } - template<template<typename, typename> class Relationship, typename Type1, typename Type2> bool diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_assign/has_nothrow_assign.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_assign/has_nothrow_assign.cc index e07fa4f589f..f8f25e8c84e 100644 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_assign/has_nothrow_assign.cc +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_assign/has_nothrow_assign.cc @@ -1,6 +1,6 @@ // 2004-12-30 Paolo Carlini <pcarlini@suse.de> // -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 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 @@ -30,23 +30,21 @@ void test01() using std::tr1::has_nothrow_assign; using namespace __gnu_test; - VERIFY( (test_assign_property<has_nothrow_assign, void>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, int>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, float>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, EnumType>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, int*>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, int(*)(int)>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, int (ClassType::*)>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, - int (ClassType::*) (int)>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, int[2]>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, float[][3]>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, EnumType[2][3][4]>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, int*[3]>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, int(*[][2])(int)>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, - int (ClassType::*[2][3])>(true)) ); - VERIFY( (test_assign_property<has_nothrow_assign, + VERIFY( (test_category<has_nothrow_assign, void>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int>(true)) ); + VERIFY( (test_category<has_nothrow_assign, float>(true)) ); + VERIFY( (test_category<has_nothrow_assign, EnumType>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int*>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int(*)(int)>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int[2]>(true)) ); + VERIFY( (test_category<has_nothrow_assign, float[][3]>(true)) ); + VERIFY( (test_category<has_nothrow_assign, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int*[3]>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_nothrow_assign, int (ClassType::*[][2][3]) (int)>(true)) ); } diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_copy/has_nothrow_copy.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_copy/has_nothrow_copy.cc index 7ba63bfa954..7d59d5aafff 100644 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_copy/has_nothrow_copy.cc +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_copy/has_nothrow_copy.cc @@ -1,6 +1,6 @@ // 2004-12-30 Paolo Carlini <pcarlini@suse.de> // -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 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 @@ -30,23 +30,21 @@ void test01() using std::tr1::has_nothrow_copy; using namespace __gnu_test; - VERIFY( (test_copy_property<has_nothrow_copy, void>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, int>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, float>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, EnumType>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, int*>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, int(*)(int)>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, int (ClassType::*)>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, - int (ClassType::*) (int)>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, int[2]>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, float[][3]>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, EnumType[2][3][4]>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, int*[3]>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, int(*[][2])(int)>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, - int (ClassType::*[2][3])>(true)) ); - VERIFY( (test_copy_property<has_nothrow_copy, + VERIFY( (test_category<has_nothrow_copy, void>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int>(true)) ); + VERIFY( (test_category<has_nothrow_copy, float>(true)) ); + VERIFY( (test_category<has_nothrow_copy, EnumType>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int*>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int(*)(int)>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int[2]>(true)) ); + VERIFY( (test_category<has_nothrow_copy, float[][3]>(true)) ); + VERIFY( (test_category<has_nothrow_copy, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int*[3]>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_nothrow_copy, int (ClassType::*[][2][3]) (int)>(true)) ); } diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_assign/has_trivial_assign.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_assign/has_trivial_assign.cc index 66b2bc18c38..466697429a7 100644 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_assign/has_trivial_assign.cc +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_assign/has_trivial_assign.cc @@ -1,6 +1,6 @@ // 2004-12-30 Paolo Carlini <pcarlini@suse.de> // -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 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 @@ -30,23 +30,21 @@ void test01() using std::tr1::has_trivial_assign; using namespace __gnu_test; - VERIFY( (test_assign_property<has_trivial_assign, void>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, int>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, float>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, EnumType>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, int*>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, int(*)(int)>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, int (ClassType::*)>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, - int (ClassType::*) (int)>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, int[2]>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, float[][3]>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, EnumType[2][3][4]>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, int*[3]>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, int(*[][2])(int)>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, - int (ClassType::*[2][3])>(true)) ); - VERIFY( (test_assign_property<has_trivial_assign, + VERIFY( (test_category<has_trivial_assign, void>(true)) ); + VERIFY( (test_category<has_trivial_assign, int>(true)) ); + VERIFY( (test_category<has_trivial_assign, float>(true)) ); + VERIFY( (test_category<has_trivial_assign, EnumType>(true)) ); + VERIFY( (test_category<has_trivial_assign, int*>(true)) ); + VERIFY( (test_category<has_trivial_assign, int(*)(int)>(true)) ); + VERIFY( (test_category<has_trivial_assign, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_trivial_assign, int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_trivial_assign, int[2]>(true)) ); + VERIFY( (test_category<has_trivial_assign, float[][3]>(true)) ); + VERIFY( (test_category<has_trivial_assign, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_trivial_assign, int*[3]>(true)) ); + VERIFY( (test_category<has_trivial_assign, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_trivial_assign, int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_trivial_assign, int (ClassType::*[][2][3]) (int)>(true)) ); } diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_copy/has_trivial_copy.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_copy/has_trivial_copy.cc index 64eed997d60..fabe255bbf8 100644 --- a/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_copy/has_trivial_copy.cc +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_copy/has_trivial_copy.cc @@ -1,6 +1,6 @@ // 2004-12-30 Paolo Carlini <pcarlini@suse.de> // -// Copyright (C) 2004 Free Software Foundation, Inc. +// Copyright (C) 2004, 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 @@ -30,23 +30,21 @@ void test01() using std::tr1::has_trivial_copy; using namespace __gnu_test; - VERIFY( (test_copy_property<has_trivial_copy, void>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, int>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, float>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, EnumType>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, int*>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, int(*)(int)>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, int (ClassType::*)>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, - int (ClassType::*) (int)>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, int[2]>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, float[][3]>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, EnumType[2][3][4]>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, int*[3]>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, int(*[][2])(int)>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, - int (ClassType::*[2][3])>(true)) ); - VERIFY( (test_copy_property<has_trivial_copy, + VERIFY( (test_category<has_trivial_copy, void>(true)) ); + VERIFY( (test_category<has_trivial_copy, int>(true)) ); + VERIFY( (test_category<has_trivial_copy, float>(true)) ); + VERIFY( (test_category<has_trivial_copy, EnumType>(true)) ); + VERIFY( (test_category<has_trivial_copy, int*>(true)) ); + VERIFY( (test_category<has_trivial_copy, int(*)(int)>(true)) ); + VERIFY( (test_category<has_trivial_copy, int (ClassType::*)>(true)) ); + VERIFY( (test_category<has_trivial_copy, int (ClassType::*) (int)>(true)) ); + VERIFY( (test_category<has_trivial_copy, int[2]>(true)) ); + VERIFY( (test_category<has_trivial_copy, float[][3]>(true)) ); + VERIFY( (test_category<has_trivial_copy, EnumType[2][3][4]>(true)) ); + VERIFY( (test_category<has_trivial_copy, int*[3]>(true)) ); + VERIFY( (test_category<has_trivial_copy, int(*[][2])(int)>(true)) ); + VERIFY( (test_category<has_trivial_copy, int (ClassType::*[2][3])>(true)) ); + VERIFY( (test_category<has_trivial_copy, int (ClassType::*[][2][3]) (int)>(true)) ); } -- GitLab