From 3ba9051e4406f0a996c1087ca1c9305e31790738 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Wed, 30 Nov 2016 18:32:24 +0200 Subject: [PATCH] Fix testsuite failures caused by the patch implementing LWG 2534. * include/std/istream (__is_convertible_to_basic_istream): Change the return types of __check, introduce istream_type. (operator>>(_Istream&&, _Tp&&)): Use __is_convertible_to_basic_istream::istream_type as the return type. * include/std/ostream (__is_convertible_to_basic_ostream): Change the return types of __check, introduce ostream_type. (operator>>(_Ostream&&, _Tp&&)): Use __is_convertible_to_basic_ostream::ostream_type as the return type. From-SVN: r243036 --- libstdc++-v3/ChangeLog | 12 ++++++++++++ libstdc++-v3/include/std/istream | 14 ++++++++------ libstdc++-v3/include/std/ostream | 15 ++++++++------- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 349a35b2350..6d3bfcc542b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2016-11-30 Ville Voutilainen + + Fix testsuite failures caused by the patch implementing LWG 2534. + * include/std/istream (__is_convertible_to_basic_istream): + Change the return types of __check, introduce istream_type. + (operator>>(_Istream&&, _Tp&&)): + Use __is_convertible_to_basic_istream::istream_type as the return type. + * include/std/ostream (__is_convertible_to_basic_ostream): + Change the return types of __check, introduce ostream_type. + (operator>>(_Ostream&&, _Tp&&)): + Use __is_convertible_to_basic_ostream::ostream_type as the return type. + 2016-11-30 Tim Shen * include/bits/shared_ptr_base.h diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream index 4f0e940b2aa..319e2264e79 100644 --- a/libstdc++-v3/include/std/istream +++ b/libstdc++-v3/include/std/istream @@ -913,11 +913,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_convertible_to_basic_istream { template - static true_type __check(basic_istream<_Ch, _Up>*); + static basic_istream<_Ch, _Up>& __check(basic_istream<_Ch, _Up>*); - static false_type __check(void*); + static void __check(void*); public: - using type = decltype(__check(declval<_Tp*>())); + using istream_type = + decltype(__check(declval::type*>())); + using type = __not_>; constexpr static bool value = type::value; }; @@ -946,10 +948,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline typename enable_if<__and_<__not_>, - __is_convertible_to_basic_istream< - typename remove_reference<_Istream>::type>, + __is_convertible_to_basic_istream<_Istream>, __is_extractable<_Istream&, _Tp&&>>::value, - _Istream&>::type + typename __is_convertible_to_basic_istream< + _Istream>::istream_type>::type operator>>(_Istream&& __is, _Tp&& __x) { __is >> std::forward<_Tp>(__x); diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream index a1fe892ccdb..70fd10ba954 100644 --- a/libstdc++-v3/include/std/ostream +++ b/libstdc++-v3/include/std/ostream @@ -617,11 +617,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct __is_convertible_to_basic_ostream { template - static true_type __check(basic_ostream<_Ch, _Up>*); + static basic_ostream<_Ch, _Up>& __check(basic_ostream<_Ch, _Up>*); - static false_type __check(void*); + static void __check(void*); public: - using type = decltype(__check(declval<_Tp*>())); + using ostream_type = + decltype(__check(declval::type*>())); + using type = __not_>; constexpr static bool value = type::value; }; @@ -647,11 +649,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline typename enable_if<__and_<__not_>, - __is_convertible_to_basic_ostream< - typename remove_reference<_Ostream>::type>, + __is_convertible_to_basic_ostream<_Ostream>, __is_insertable<_Ostream&, const _Tp&>>::value, - _Ostream&>::type - //basic_ostream<_CharT, _Traits>& + typename __is_convertible_to_basic_ostream< + _Ostream>::ostream_type>::type operator<<(_Ostream&& __os, const _Tp& __x) { __os << __x; -- 2.30.2