[v3 PATCH] Fix testsuite failures caused by the patch implementing LWG 2534.

Ville Voutilainen ville.voutilainen@gmail.com
Wed Nov 30 15:58:00 GMT 2016


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 stream_type.
    (operator>>(_Istream&&, _Tp&&)):
    Use __is_convertible_to_basic_istream::stream_type as the return type.
    * include/std/ostream (__is_convertible_to_basic_ostream):
    Change the return types of __check, introduce stream_type.
    (operator>>(_Ostream&&, _Tp&&)):
    Use __is_convertible_to_basic_ostream::stream_type as the return type.
-------------- next part --------------
diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream
index 4f0e940..81df402 100644
--- a/libstdc++-v3/include/std/istream
+++ b/libstdc++-v3/include/std/istream
@@ -913,11 +913,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct __is_convertible_to_basic_istream
     {
       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:
-      using type = decltype(__check(declval<_Tp*>()));
+      using stream_type = decltype(__check(declval<_Tp*>()));
+      using type = __not_<is_same<stream_type, void>>;
       constexpr static bool value = type::value;
   };
 
@@ -949,7 +950,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 			      __is_convertible_to_basic_istream<
 				typename remove_reference<_Istream>::type>,
 			      __is_extractable<_Istream&, _Tp&&>>::value,
-		       _Istream&>::type
+		       typename __is_convertible_to_basic_istream<
+			 typename
+			 remove_reference<_Istream>::type>::stream_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 a1fe892..64db7c7 100644
--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -617,11 +617,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     struct __is_convertible_to_basic_ostream
   {
     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:
-    using type = decltype(__check(declval<_Tp*>()));
+    using stream_type = decltype(__check(declval<_Tp*>()));
+    using type = __not_<is_same<stream_type, void>>;
     constexpr static bool value = type::value;
   };
 
@@ -650,8 +651,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 			      __is_convertible_to_basic_ostream<
 				typename remove_reference<_Ostream>::type>,
 			      __is_insertable<_Ostream&, const _Tp&>>::value,
-		       _Ostream&>::type
-				      //basic_ostream<_CharT, _Traits>&
+		       typename __is_convertible_to_basic_ostream<
+			 typename
+			 remove_reference<_Ostream>::type>::stream_type>::type
     operator<<(_Ostream&& __os, const _Tp& __x)
     {
       __os << __x;


More information about the Gcc-patches mailing list