Commit 3ba9051e by Ville Voutilainen Committed by 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.

From-SVN: r243036
parent 917b47be
2016-11-30 Ville Voutilainen <ville.voutilainen@gmail.com>
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 <timshen@google.com> 2016-11-30 Tim Shen <timshen@google.com>
* include/bits/shared_ptr_base.h * include/bits/shared_ptr_base.h
......
...@@ -913,11 +913,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -913,11 +913,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __is_convertible_to_basic_istream struct __is_convertible_to_basic_istream
{ {
template<typename _Ch, typename _Up> template<typename _Ch, typename _Up>
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: public:
using type = decltype(__check(declval<_Tp*>())); using istream_type =
decltype(__check(declval<typename remove_reference<_Tp>::type*>()));
using type = __not_<is_same<istream_type, void>>;
constexpr static bool value = type::value; constexpr static bool value = type::value;
}; };
...@@ -946,10 +948,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -946,10 +948,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Istream, typename _Tp> template<typename _Istream, typename _Tp>
inline inline
typename enable_if<__and_<__not_<is_lvalue_reference<_Istream>>, typename enable_if<__and_<__not_<is_lvalue_reference<_Istream>>,
__is_convertible_to_basic_istream< __is_convertible_to_basic_istream<_Istream>,
typename remove_reference<_Istream>::type>,
__is_extractable<_Istream&, _Tp&&>>::value, __is_extractable<_Istream&, _Tp&&>>::value,
_Istream&>::type typename __is_convertible_to_basic_istream<
_Istream>::istream_type>::type
operator>>(_Istream&& __is, _Tp&& __x) operator>>(_Istream&& __is, _Tp&& __x)
{ {
__is >> std::forward<_Tp>(__x); __is >> std::forward<_Tp>(__x);
......
...@@ -617,11 +617,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -617,11 +617,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __is_convertible_to_basic_ostream struct __is_convertible_to_basic_ostream
{ {
template<typename _Ch, typename _Up> template<typename _Ch, typename _Up>
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: public:
using type = decltype(__check(declval<_Tp*>())); using ostream_type =
decltype(__check(declval<typename remove_reference<_Tp>::type*>()));
using type = __not_<is_same<ostream_type, void>>;
constexpr static bool value = type::value; constexpr static bool value = type::value;
}; };
...@@ -647,11 +649,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -647,11 +649,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Ostream, typename _Tp> template<typename _Ostream, typename _Tp>
inline inline
typename enable_if<__and_<__not_<is_lvalue_reference<_Ostream>>, typename enable_if<__and_<__not_<is_lvalue_reference<_Ostream>>,
__is_convertible_to_basic_ostream< __is_convertible_to_basic_ostream<_Ostream>,
typename remove_reference<_Ostream>::type>,
__is_insertable<_Ostream&, const _Tp&>>::value, __is_insertable<_Ostream&, const _Tp&>>::value,
_Ostream&>::type typename __is_convertible_to_basic_ostream<
//basic_ostream<_CharT, _Traits>& _Ostream>::ostream_type>::type
operator<<(_Ostream&& __os, const _Tp& __x) operator<<(_Ostream&& __os, const _Tp& __x)
{ {
__os << __x; __os << __x;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment