diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-04-07 14:12:25 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2024-06-21 10:19:35 +0100 |
commit | 577225a268ad203647746d4ae98620da0354d0a0 (patch) | |
tree | 50b41cfd32d8253fe34af72aed269813c96b1479 | |
parent | bb7d052adce7292d15a8400886013ff1843f774e (diff) | |
download | gcc-577225a268ad203647746d4ae98620da0354d0a0.zip gcc-577225a268ad203647746d4ae98620da0354d0a0.tar.gz gcc-577225a268ad203647746d4ae98620da0354d0a0.tar.bz2 |
libstdc++: Add deprecation warnings to <strstream> types
libstdc++-v3/ChangeLog:
* include/backward/backward_warning.h: Adjust comments to
suggest <spanstream> as another alternative to <strstream>.
* include/backward/strstream (strstreambuf, istrstream)
(ostrstream, strstream): Add deprecated attribute.
-rw-r--r-- | libstdc++-v3/include/backward/backward_warning.h | 12 | ||||
-rw-r--r-- | libstdc++-v3/include/backward/strstream | 20 |
2 files changed, 24 insertions, 8 deletions
diff --git a/libstdc++-v3/include/backward/backward_warning.h b/libstdc++-v3/include/backward/backward_warning.h index 3f33303..834fc56 100644 --- a/libstdc++-v3/include/backward/backward_warning.h +++ b/libstdc++-v3/include/backward/backward_warning.h @@ -40,10 +40,14 @@ A list of valid replacements is as follows: Use: Instead of: - <sstream>, basic_stringbuf <strstream>, strstreambuf - <sstream>, basic_istringstream <strstream>, istrstream - <sstream>, basic_ostringstream <strstream>, ostrstream - <sstream>, basic_stringstream <strstream>, strstream + <sstream>, stringbuf + or <spanstream>, spanbuf <strstream>, strstreambuf + <sstream>, istringstream + or <spanstream>, ispanstream <strstream>, istrstream + <sstream>, ostringstream + or <spanstream>, ospanstream <strstream>, ostrstream + <sstream>, stringstream + or <spanstream>, spanstream <strstream>, strstream <unordered_set>, unordered_set <ext/hash_set>, hash_set <unordered_set>, unordered_multiset <ext/hash_set>, hash_multiset <unordered_map>, unordered_map <ext/hash_map>, hash_map diff --git a/libstdc++-v3/include/backward/strstream b/libstdc++-v3/include/backward/strstream index 152e937..5e42114 100644 --- a/libstdc++-v3/include/backward/strstream +++ b/libstdc++-v3/include/backward/strstream @@ -57,6 +57,12 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION +#if __glibcxx_spanstream +# define _GLIBCXX_STRSTREAM_DEPR(A, B) _GLIBCXX_DEPRECATED_SUGGEST(A "' or '" B) +#else +# define _GLIBCXX_STRSTREAM_DEPR(A, B) _GLIBCXX_DEPRECATED_SUGGEST(A) +#endif + // Class strstreambuf, a streambuf class that manages an array of char. // Note that this class is not a template. class strstreambuf : public basic_streambuf<char, char_traits<char> > @@ -151,7 +157,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool _M_dynamic : 1; bool _M_frozen : 1; bool _M_constant : 1; - }; + } _GLIBCXX_STRSTREAM_DEPR("std::stringbuf", "std::spanbuf"); + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" // Class istrstream, an istream that manages a strstreambuf. class istrstream : public basic_istream<char> @@ -176,7 +185,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: strstreambuf _M_buf; - }; + } _GLIBCXX_STRSTREAM_DEPR("std::istringstream", "std::ispanstream"); // Class ostrstream class ostrstream : public basic_ostream<char> @@ -201,7 +210,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: strstreambuf _M_buf; - }; + } _GLIBCXX_STRSTREAM_DEPR("std::ostringstream", "std::ospanstream"); // Class strstream class strstream : public basic_iostream<char> @@ -231,7 +240,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: strstreambuf _M_buf; - }; + } _GLIBCXX_STRSTREAM_DEPR("std::stringstream", "std::spanstream"); + +#undef _GLIBCXX_STRSTREAM_DEPR +#pragma GCC diagnostic pop _GLIBCXX_END_NAMESPACE_VERSION } // namespace |