summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-25 17:47:52 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-25 17:47:52 +0000
commitbf4f61c0a3d3d419da8a44cf77b9c45c210cafea (patch)
tree67bf4f92145bf1720f5cc60917a9db7dbd3cd0d3 /libstdc++-v3
parentc3aec137ea5dbcdb69b0e3d6d0eb940c702e427a (diff)
downloadgcc-bf4f61c0a3d3d419da8a44cf77b9c45c210cafea.tar.gz
Remove deprecated iostream members for C++17
* include/bits/ios_base.h (ios_base::io_state, ios_base::open_mode) (ios_base::seek_dir): Remove for C++17. * include/std/streambuf (basic_streambuf::stossc): Remove for C++17. Add deprecated attribute for C++11 and C++14. * testsuite/27_io/types/1.cc: Don't run for C++17 and later. * testsuite/27_io/types/4.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250531 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog9
-rw-r--r--libstdc++-v3/include/bits/ios_base.h4
-rw-r--r--libstdc++-v3/include/std/streambuf7
-rw-r--r--libstdc++-v3/testsuite/27_io/types/1.cc8
-rw-r--r--libstdc++-v3/testsuite/27_io/types/4.cc29
5 files changed, 48 insertions, 9 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 0a875971771..6e5d2f988a8 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,12 @@
+2017-07-25 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/ios_base.h (ios_base::io_state, ios_base::open_mode)
+ (ios_base::seek_dir): Remove for C++17.
+ * include/std/streambuf (basic_streambuf::stossc): Remove for C++17.
+ Add deprecated attribute for C++11 and C++14.
+ * testsuite/27_io/types/1.cc: Don't run for C++17 and later.
+ * testsuite/27_io/types/4.cc: New.
+
2017-07-23 Michael Collison <michael.collison@arm.com>
Add optimized implementation of mersenne twister for aarch64
diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h
index e5a107db4bc..e68b4305517 100644
--- a/libstdc++-v3/include/bits/ios_base.h
+++ b/libstdc++-v3/include/bits/ios_base.h
@@ -469,13 +469,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// Request a seek relative to the current end of the sequence.
static const seekdir end = _S_end;
- // Annex D.6
+#if __cplusplus <= 201402L
+ // Annex D.6 (removed in C++17)
typedef int io_state;
typedef int open_mode;
typedef int seek_dir;
typedef std::streampos streampos;
typedef std::streamoff streamoff;
+#endif
// Callbacks;
/**
diff --git a/libstdc++-v3/include/std/streambuf b/libstdc++-v3/include/std/streambuf
index 862c4fdbe6d..a05b46e8199 100644
--- a/libstdc++-v3/include/std/streambuf
+++ b/libstdc++-v3/include/std/streambuf
@@ -768,8 +768,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
overflow(int_type __c = traits_type::eof())
{ return traits_type::eof(); }
-#if _GLIBCXX_USE_DEPRECATED
- // Annex D.6
+#if _GLIBCXX_USE_DEPRECATED && __cplusplus <= 201402L
+ // Annex D.6 (removed in C++17)
public:
/**
* @brief Tosses a character.
@@ -779,6 +779,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*
* See http://gcc.gnu.org/ml/libstdc++/2002-05/msg00168.html
*/
+#if __cplusplus >= 201103L
+ [[__deprecated__("stossc is deprecated, use sbumpc instead")]]
+#endif
void
stossc()
{
diff --git a/libstdc++-v3/testsuite/27_io/types/1.cc b/libstdc++-v3/testsuite/27_io/types/1.cc
index 88f6ff868d7..0756f8a1709 100644
--- a/libstdc++-v3/testsuite/27_io/types/1.cc
+++ b/libstdc++-v3/testsuite/27_io/types/1.cc
@@ -15,6 +15,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+// { dg-do compile { target c++14_down } }
+
// 27.4.2.1 - Types [lib.ios.types]
#include <ios>
@@ -27,9 +29,3 @@ void test01()
typedef std::ios_base::streampos streampos_type;
typedef std::ios_base::streamoff streamoff_type;
}
-
-int main(void)
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/types/4.cc b/libstdc++-v3/testsuite/27_io/types/4.cc
new file mode 100644
index 00000000000..ee1a77736ce
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/types/4.cc
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++1z } }
+
+// In C++17 these names are not reserved by the library.
+#define io_state 1
+#define open_mode 2
+#define seek_dir 3
+#define stossc 4
+#include <streambuf>
+
+template class std::basic_streambuf<char>;
+template class std::basic_streambuf<wchar_t>;