From 297f34d71988b2599ac2a68332c47eba0c7345dc Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 30 Oct 2009 13:12:08 +0000 Subject: [PATCH] type_traits (__is_convertible_simple): Remove. 2009-10-30 Paolo Carlini * include/std/type_traits (__is_convertible_simple): Remove. (__is_convertible_helper): Adjust. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error line numbers. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. From-SVN: r153743 --- libstdc++-v3/ChangeLog | 9 ++++++ libstdc++-v3/include/std/type_traits | 28 +++++++------------ .../make_signed/requirements/typedefs_neg.cc | 4 +-- .../requirements/typedefs_neg.cc | 4 +-- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a59710da9ef..05e2c3360be 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2009-10-30 Paolo Carlini + + * include/std/type_traits (__is_convertible_simple): Remove. + (__is_convertible_helper): Adjust. + * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust + dg-error line numbers. + * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: + Likewise. + 2009-10-30 Jerry Quinn * libsupc++/tinfo.cc (operator=(const type_info&)): Revert 153734. diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index f5666bcc062..2824638354a 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -240,34 +240,26 @@ namespace std { }; // Relationships between types. + template::value || is_void<_To>::value + || is_function<_To>::value || is_array<_To>::value)> + struct __is_convertible_helper + { static const bool __value = (is_void<_From>::value + && is_void<_To>::value); }; + template - struct __is_convertible_simple + struct __is_convertible_helper<_From, _To, false> : public __sfinae_types { private: static __one __test(_To); static __two __test(...); - static _From __makeFrom(); - + static typename add_rvalue_reference<_From>::type __makeFrom(); + public: static const bool __value = sizeof(__test(__makeFrom())) == 1; }; - template::value || is_void<_To>::value - || is_function<_To>::value || is_array<_To>::value)> - struct __is_convertible_helper - { - static const bool __value = (__is_convertible_simple::type, - _To>::__value); - }; - - template - struct __is_convertible_helper<_From, _To, true> - { static const bool __value = (is_void<_From>::value - && is_void<_To>::value); }; - // XXX FIXME // The C++0x specifications require front-end support, see N2255. /// is_convertible 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 5b129e860e8..9319a481146 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,8 +48,8 @@ void test01() // { dg-error "instantiated from here" "" { target *-*-* } 40 } // { dg-error "instantiated from here" "" { target *-*-* } 42 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 554 } -// { dg-error "declaration of" "" { target *-*-* } 516 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 546 } +// { dg-error "declaration of" "" { target *-*-* } 508 } // { dg-excess-errors "At global scope" } // { dg-excess-errors "In instantiation of" } 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 fc58ffecf70..7497767b165 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,8 +48,8 @@ void test01() // { dg-error "instantiated from here" "" { target *-*-* } 40 } // { dg-error "instantiated from here" "" { target *-*-* } 42 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 475 } -// { dg-error "declaration of" "" { target *-*-* } 437 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 467 } +// { dg-error "declaration of" "" { target *-*-* } 429 } // { dg-excess-errors "At global scope" } // { dg-excess-errors "In instantiation of" }