https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88111

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thanks! I'll look through that when I get a chance.

For the iostream case I think it should always be possible to write size_t to a
stream, so we might want to solve it properly with overloads like:


--- a/libstdc++-v3/include/std/ostream
+++ b/libstdc++-v3/include/std/ostream
@@ -690,6 +690,26 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     }
 #endif // C++11

+#if defined(__GLIBCXX_TYPE_INT_N_0)
+  template<typename _CharT, typename _Traits>
+    inline basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __os,
+              __GLIBCXX_TYPE_INT_N_0 __x)
+    {
+      __os << (__x + 0);
+      return __os;
+    }
+
+  template<typename _CharT, typename _Traits>
+    inline basic_ostream<_CharT, _Traits>&
+    operator<<(basic_ostream<_CharT, _Traits>& __os,
+              unsigned __GLIBCXX_TYPE_INT_N_0 __x)
+    {
+      __os << (__x + 0u);
+      return __os;
+    }
+#endif
+
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std

Reply via email to