summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-05-10 13:03:14 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-05-10 18:24:19 +0100
commit3e6067bdcab5f677526d80325b9b8dc03f49024d (patch)
tree1836c708ffec9f68191d2134ec6e1d47b0864149 /libstdc++-v3/include
parentab8a8d053734d6abc6ee9c5bfb772ff95ba74fc9 (diff)
libstdc++: Add <syncstream> declarations to <iosfwd> [PR105284]
libstdc++-v3/ChangeLog: PR libstdc++/105284 * include/std/iosfwd: Add declarations for <synstream> class templates and typedefs. * include/std/syncstream (basic_syncbuf, basic_osyncstream): Remove default template arguments. * testsuite/27_io/headers/iosfwd/synopsis.cc: New test. * testsuite/27_io/headers/iosfwd/types.cc: New test. (cherry picked from commit 1807e07825a86916bbfddca470708c5a8f613612)
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r--libstdc++-v3/include/std/iosfwd18
-rw-r--r--libstdc++-v3/include/std/syncstream6
2 files changed, 20 insertions, 4 deletions
diff --git a/libstdc++-v3/include/std/iosfwd b/libstdc++-v3/include/std/iosfwd
index 2d79a131631..c8c67c86c3b 100644
--- a/libstdc++-v3/include/std/iosfwd
+++ b/libstdc++-v3/include/std/iosfwd
@@ -207,6 +207,24 @@ _GLIBCXX_END_NAMESPACE_CXX11
/// Class for @c wchar_t mixed input and output file streams.
typedef basic_fstream<wchar_t> wfstream;
#endif
+
+#if __cplusplus >= 202002L && _GLIBCXX_USE_CXX11_ABI
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Allocator = allocator<_CharT>>
+ class basic_syncbuf;
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Allocator = allocator<_CharT>>
+ class basic_osyncstream;
+
+ using syncbuf = basic_syncbuf<char>;
+ using osyncstream = basic_osyncstream<char>;
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ using wsyncbuf = basic_syncbuf<wchar_t>;
+ using wosyncstream = basic_osyncstream<wchar_t>;
+#endif
+#endif // C++20 && CXX11_ABI
+
/** @} */
_GLIBCXX_END_NAMESPACE_VERSION
diff --git a/libstdc++-v3/include/std/syncstream b/libstdc++-v3/include/std/syncstream
index 3cf2296f723..7a4f731ddd9 100644
--- a/libstdc++-v3/include/std/syncstream
+++ b/libstdc++-v3/include/std/syncstream
@@ -50,8 +50,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
- template<typename _CharT, typename _Traits = char_traits<_CharT>,
- typename _Alloc = allocator<_CharT>>
+ template<typename _CharT, typename _Traits, typename _Alloc>
class basic_syncbuf : public __syncbuf_base<_CharT, _Traits>
{
public:
@@ -241,8 +240,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__mutex _M_mtx;
};
- template <typename _CharT, typename _Traits = char_traits<_CharT>,
- typename _Alloc = allocator<_CharT>>
+ template <typename _CharT, typename _Traits, typename _Alloc>
class basic_osyncstream : public basic_ostream<_CharT, _Traits>
{
using __ostream_type = basic_ostream<_CharT, _Traits>;