template<typename _Codecvt, typename _Elem = wchar_t,
typename _Wide_alloc = allocator<_Elem>,
typename _Byte_alloc = allocator<char>>
- class wstring_convert
+ class _GLIBCXX17_DEPRECATED wstring_convert
{
public:
typedef basic_string<char, char_traits<char>, _Byte_alloc> byte_string;
/// Buffer conversions
template<typename _Codecvt, typename _Elem = wchar_t,
typename _Tr = char_traits<_Elem>>
- class wbuffer_convert : public basic_streambuf<_Elem, _Tr>
+ class _GLIBCXX17_DEPRECATED wbuffer_convert
+ : public basic_streambuf<_Elem, _Tr>
{
typedef basic_streambuf<_Elem, _Tr> _Wide_streambuf;
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++11 } }
+// { dg-additional-options "-Wno-deprecated-declarations" { target c++17 } }
#include <locale>
#include <codecvt>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++11 } }
+// { dg-additional-options "-Wno-deprecated-declarations" { target c++17 } }
#include <codecvt>
#include <locale>
// <http://www.gnu.org/licenses/>.
// { dg-do run { target c++11 } }
+// { dg-additional-options "-Wno-deprecated-declarations" { target c++17 } }
#include <locale>
#include <codecvt>
template<typename Elem>
using buf_conv = std::wbuffer_convert<cvt<Elem>, Elem>;
+// { dg-warning "deprecated" "" { target c++17 } 31 }
using std::string;
using std::wstring;
struct Cvt : std::codecvt<char, char, std::mbstate_t> { };
std::stringstream ss;
std::wbuffer_convert<Cvt, char> cvt(ss.rdbuf());
+ // { dg-warning "deprecated" "" { target c++17 } 29 }
auto p = ss.std::ios::rdbuf(&cvt);
ss << "hello";
VERIFY( ss.flush().good() );
// https://gcc.gnu.org/ml/libstdc++/2017-11/msg00022.html
streambuf sb;
std::wbuffer_convert<codecvt> conv(&sb);
+ // { dg-warning "deprecated" "" { target c++17 } 49 }
VERIFY( sb.in_avail() == 0 );
wchar_t c = conv.sgetc();
VERIFY( c == L'a' );
// https://gcc.gnu.org/ml/libstdc++/2017-11/msg00022.html
streambuf sb;
std::wbuffer_convert<codecvt, char16_t> conv(&sb);
+ // { dg-warning "deprecated" "" { target c++17 } 64 }
VERIFY( sb.in_avail() == 0 );
char16_t c = conv.sgetc();
VERIFY( c == u'a' );
// Check for required typedefs
struct cvt_type : std::codecvt<wchar_t, char, mbstate_t> { };
typedef std::char_traits<wchar_t> traits_type;
- typedef std::wbuffer_convert<cvt_type, wchar_t, traits_type> test_type;
+ typedef std::wbuffer_convert<cvt_type, wchar_t, traits_type> test_type; // { dg-warning "deprecated" "" { target c++17 } }
typedef test_type::state_type state_type;
static_assert( std::is_same<cvt_type::state_type, state_type>::value,
template<typename Elem>
using str_conv = std::wstring_convert<cvt<Elem>, Elem>;
+// { dg-warning "deprecated" "" { target c++17 } 31 }
using std::string;
using std::wstring;
template<typename Elem>
using str_conv = std::wstring_convert<cvt<Elem>, Elem>;
+// { dg-warning "deprecated" "" { target c++17 } 30 }
using std::string;
using std::u16string;
template<typename Elem>
using str_conv = std::wstring_convert<cvt<Elem>, Elem>;
+// { dg-warning "deprecated" "" { target c++17 } 30 }
using std::string;
using std::u16string;
// convert from UCS-4 to UTF16BE with BOM.
using cvt = std::codecvt_utf16<char32_t, 0x10FFFF, std::generate_header>;
std::wstring_convert<cvt, char32_t> conv;
+ // { dg-warning "deprecated" "" { target c++17 } 31 }
auto to = conv.to_bytes(U"ab\u00e7");
VERIFY( to.length() == 8 );
struct cvt : std::codecvt<wchar_t, char, std::mbstate_t> { };
using wconv = std::wstring_convert<cvt, wchar_t, alloc<wchar_t>, alloc<char>>;
+// { dg-warning "deprecated" "" { target c++17 } 35 }
static_assert( std::is_same<wconv::byte_string, Str<char>>::value,
"byte string is std::string" );
// Check for required typedefs
typedef std::codecvt<wchar_t, char, mbstate_t> codecvt_type;
typedef std::wstring_convert<codecvt_type> test_type;
+ // { dg-warning "deprecated" "" { target c++17 } 28 }
typedef test_type::byte_string byte_string;
typedef test_type::wide_string wide_string;
typedef test_type::state_type state_type;