public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [v3 PATCH] Fix testsuite failures caused by the patch implementing LWG 2534.
@ 2016-11-30 15:58 Ville Voutilainen
  2016-11-30 16:25 ` Jonathan Wakely
  0 siblings, 1 reply; 7+ messages in thread
From: Ville Voutilainen @ 2016-11-30 15:58 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 608 bytes --]

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.

[-- Attachment #2: lwg2534_fix.diff --]
[-- Type: text/plain, Size: 2499 bytes --]

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;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-12-01  7:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-30 15:58 [v3 PATCH] Fix testsuite failures caused by the patch implementing LWG 2534 Ville Voutilainen
2016-11-30 16:25 ` Jonathan Wakely
2016-12-01  5:38   ` Markus Trippelsdorf
2016-12-01  6:11     ` Ville Voutilainen
2016-12-01  6:45       ` Markus Trippelsdorf
2016-12-01  7:14         ` Ville Voutilainen
2016-12-01  7:17           ` Ville Voutilainen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).