diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-03-22 13:19:09 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2024-06-21 10:19:35 +0100 |
commit | bb7d052adce7292d15a8400886013ff1843f774e (patch) | |
tree | c69c29c7a92fa34a6c61c22ab78573ae6766d080 /libstdc++-v3/testsuite | |
parent | f906b107634bfac29676e7fcf364d0ca7ceed666 (diff) | |
download | gcc-bb7d052adce7292d15a8400886013ff1843f774e.zip gcc-bb7d052adce7292d15a8400886013ff1843f774e.tar.gz gcc-bb7d052adce7292d15a8400886013ff1843f774e.tar.bz2 |
libstdc++: Add [[deprecated]] to std::wstring_convert and std::wbuffer_convert
These were deprecated in C++17 and std::wstring_convert is planned for
removal in C++26.
libstdc++-v3/ChangeLog:
* include/bits/locale_conv.h (wstring_convert): Add deprecated
attribute for C++17 and later.
(wbuffer_convert): Likewise.
* testsuite/22_locale/codecvt/codecvt_utf16/79980.cc: Disable
deprecated warnings.
* testsuite/22_locale/codecvt/codecvt_utf8/79980.cc: Likewise.
* testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc:
Likewise.
* testsuite/22_locale/conversions/buffer/1.cc: Add dg-warning.
* testsuite/22_locale/conversions/buffer/2.cc: Likewise.
* testsuite/22_locale/conversions/buffer/3.cc: Likewise.
* testsuite/22_locale/conversions/buffer/requirements/typedefs.cc:
Likewise.
* testsuite/22_locale/conversions/string/1.cc: Likewise.
* testsuite/22_locale/conversions/string/2.cc: Likewise.
* testsuite/22_locale/conversions/string/3.cc: Likewise.
* testsuite/22_locale/conversions/string/66441.cc: Likewise.
* testsuite/22_locale/conversions/string/requirements/typedefs-2.cc:
Likewise.
* testsuite/22_locale/conversions/string/requirements/typedefs.cc:
Likewise.
Diffstat (limited to 'libstdc++-v3/testsuite')
13 files changed, 14 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf16/79980.cc b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf16/79980.cc index 1c6711b..90cb844 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf16/79980.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf16/79980.cc @@ -16,6 +16,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do run { target c++11 } } +// { dg-additional-options "-Wno-deprecated-declarations" { target c++17 } } #include <locale> #include <codecvt> diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc index d6cd89c..66aadc1 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc @@ -16,6 +16,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do run { target c++11 } } +// { dg-additional-options "-Wno-deprecated-declarations" { target c++17 } } #include <codecvt> #include <locale> diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc index d09aa41..e693481 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc @@ -16,6 +16,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do run { target c++11 } } +// { dg-additional-options "-Wno-deprecated-declarations" { target c++17 } } #include <locale> #include <codecvt> diff --git a/libstdc++-v3/testsuite/22_locale/conversions/buffer/1.cc b/libstdc++-v3/testsuite/22_locale/conversions/buffer/1.cc index 6b1ea95..6312566 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/buffer/1.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/buffer/1.cc @@ -29,6 +29,7 @@ struct cvt : std::codecvt<Elem, char, std::mbstate_t> { }; 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; diff --git a/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc b/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc index 42653a9..5b3da13 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/buffer/2.cc @@ -27,6 +27,7 @@ test01() 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() ); diff --git a/libstdc++-v3/testsuite/22_locale/conversions/buffer/3.cc b/libstdc++-v3/testsuite/22_locale/conversions/buffer/3.cc index de2c1a4..5dcb9c5 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/buffer/3.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/buffer/3.cc @@ -47,6 +47,7 @@ test01() // 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' ); @@ -61,6 +62,7 @@ test02() // 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' ); diff --git a/libstdc++-v3/testsuite/22_locale/conversions/buffer/requirements/typedefs.cc b/libstdc++-v3/testsuite/22_locale/conversions/buffer/requirements/typedefs.cc index 2f4ca01..bdd3c57 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/buffer/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/buffer/requirements/typedefs.cc @@ -27,7 +27,7 @@ void test01() // 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, diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc index b41bdc5..33b9bdc 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/1.cc @@ -29,6 +29,7 @@ struct cvt : std::codecvt<Elem, char, std::mbstate_t> { }; 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; diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc index ac97ff4..c2b6496 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc @@ -28,6 +28,7 @@ struct cvt : std::codecvt<Elem, char, std::mbstate_t> { }; 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; diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc index 5570ab6..5a669e7 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc @@ -28,6 +28,7 @@ struct cvt : std::codecvt<Elem, char, std::mbstate_t> { }; 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; diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/66441.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/66441.cc index 104d2f7..f27204a 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/66441.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/66441.cc @@ -29,6 +29,7 @@ test01() // 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 ); diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs-2.cc index 487f890..5026b8c 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs-2.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs-2.cc @@ -33,6 +33,7 @@ template<typename C> 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" ); diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs.cc index d7f5e44..9405df4 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/requirements/typedefs.cc @@ -26,6 +26,7 @@ void test01() // 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; |