]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Add deprecated attributes to old iostream members
authorJonathan Wakely <jwakely@redhat.com>
Wed, 19 Aug 2020 11:13:03 +0000 (12:13 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 19 Aug 2020 11:39:23 +0000 (12:39 +0100)
commit495bdda5305b366e6f15134431d9d18b952884fc
tree196e3c612ff7fd5f6059285038695cbb976884fe
parent25512fdf4d49f30212897dfb07ecef262a94e646
libstdc++: Add deprecated attributes to old iostream members

Back in 2017 I removed these prehistoric members (which were deprecated
since C++98) for C++17 mode. But I didn't add deprecated attributes to
most of them, so users didn't get any warning they would be going away.
Apparently some poor souls do actually use some of these names, and so
now that GCC 11 defaults to -std=gnu++17 some code has stopped
compiling.

This adds deprecated attributes to them, so that C++98/03/11/14 code
will get a warning if it uses them. I'll also backport this to the
release branches so that users can find out about the deprecation before
they start using C++17.

libstdc++-v3/ChangeLog:

* include/bits/c++config (_GLIBCXX_DEPRECATED_SUGGEST): New
macro for "use 'foo' instead" message in deprecated warnings.
* include/bits/ios_base.h (io_state, open_mode, seek_dir)
(streampos, streamoff): Use _GLIBCXX_DEPRECATED_SUGGEST.
* include/std/streambuf (stossc): Replace C++11 attribute
with _GLIBCXX_DEPRECATED_SUGGEST.
* testsuite/27_io/types/1.cc: Check for deprecated warnings.
Also check for io_state, open_mode and seek_dir typedefs.

(cherry picked from commit eef9bf4ca8d90a1751bc4bff03722ee68999eb8e)
libstdc++-v3/include/bits/c++config
libstdc++-v3/include/bits/ios_base.h
libstdc++-v3/include/std/streambuf
libstdc++-v3/testsuite/27_io/types/1.cc
This page took 0.064194 seconds and 5 git commands to generate.