From 8aadda9a19390ec51652951e8f2faa60b4f064e1 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Thu, 29 Oct 2015 05:43:30 +0000 Subject: [PATCH] Implement P0004R1 'Remove Deprecated iostreams aliases' git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@251618 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/ios | 15 +++++++++------ test/std/depr/depr.ios.members/io_state.pass.cpp | 5 +++++ test/std/depr/depr.ios.members/open_mode.pass.cpp | 5 +++++ test/std/depr/depr.ios.members/seek_dir.pass.cpp | 5 +++++ test/std/depr/depr.ios.members/streamoff.pass.cpp | 5 +++++ test/std/depr/depr.ios.members/streampos.pass.cpp | 5 +++++ www/cxx1z_status.html | 2 +- 7 files changed, 35 insertions(+), 7 deletions(-) diff --git a/include/ios b/include/ios index 8843ed4c..1deb5f61 100644 --- a/include/ios +++ b/include/ios @@ -114,9 +114,9 @@ class basic_ios public: // types: typedef charT char_type; - typedef typename traits::int_type int_type; - typedef typename traits::pos_type pos_type; - typedef typename traits::off_type off_type; + typedef typename traits::int_type int_type; // removed in C++17 + typedef typename traits::pos_type pos_type; // removed in C++17 + typedef typename traits::off_type off_type; // removed in C++17 typedef traits traits_type; operator unspecified-bool-type() const; @@ -254,14 +254,12 @@ public: static const fmtflags floatfield = scientific | fixed; typedef unsigned int iostate; - typedef iostate io_state; static const iostate badbit = 0x1; static const iostate eofbit = 0x2; static const iostate failbit = 0x4; static const iostate goodbit = 0x0; typedef unsigned int openmode; - typedef openmode open_mode; static const openmode app = 0x01; static const openmode ate = 0x02; static const openmode binary = 0x04; @@ -270,10 +268,15 @@ public: static const openmode trunc = 0x20; enum seekdir {beg, cur, end}; - typedef seekdir seek_dir; + +#if _LIBCPP_STD_VER <= 14 + typedef iostate io_state; + typedef openmode open_mode; + typedef seekdir seek_dir; typedef _VSTD::streamoff streamoff; typedef _VSTD::streampos streampos; +#endif class _LIBCPP_TYPE_VIS Init; diff --git a/test/std/depr/depr.ios.members/io_state.pass.cpp b/test/std/depr/depr.ios.members/io_state.pass.cpp index 15bfbf19..6b362d01 100644 --- a/test/std/depr/depr.ios.members/io_state.pass.cpp +++ b/test/std/depr/depr.ios.members/io_state.pass.cpp @@ -15,11 +15,16 @@ // typedef T1 io_state; // }; +// These members were removed for C++17 + +#include "test_macros.h" #include #include int main() { +#if TEST_STD_VER <= 14 std::strstream::io_state b = std::strstream::eofbit; assert(b == std::ios::eofbit); +#endif } diff --git a/test/std/depr/depr.ios.members/open_mode.pass.cpp b/test/std/depr/depr.ios.members/open_mode.pass.cpp index 12a8e945..cf91e7c9 100644 --- a/test/std/depr/depr.ios.members/open_mode.pass.cpp +++ b/test/std/depr/depr.ios.members/open_mode.pass.cpp @@ -15,11 +15,16 @@ // typedef T2 open_mode; // }; +// These members were removed for C++17 + +#include "test_macros.h" #include #include int main() { +#if TEST_STD_VER <= 14 std::strstream::open_mode b = std::strstream::app; assert(b == std::ios::app); +#endif } diff --git a/test/std/depr/depr.ios.members/seek_dir.pass.cpp b/test/std/depr/depr.ios.members/seek_dir.pass.cpp index 891a7a34..0dd70c10 100644 --- a/test/std/depr/depr.ios.members/seek_dir.pass.cpp +++ b/test/std/depr/depr.ios.members/seek_dir.pass.cpp @@ -15,11 +15,16 @@ // typedef T3 seek_dir; // }; +// These members were removed for C++17 + +#include "test_macros.h" #include #include int main() { +#if TEST_STD_VER <= 14 std::strstream::seek_dir b = std::strstream::cur; assert(b == std::ios::cur); +#endif } diff --git a/test/std/depr/depr.ios.members/streamoff.pass.cpp b/test/std/depr/depr.ios.members/streamoff.pass.cpp index 4ccfd1f7..0c237b35 100644 --- a/test/std/depr/depr.ios.members/streamoff.pass.cpp +++ b/test/std/depr/depr.ios.members/streamoff.pass.cpp @@ -15,11 +15,16 @@ // typedef OFF_T streamoff; // }; +// These members were removed for C++17 + +#include "test_macros.h" #include #include int main() { +#if TEST_STD_VER <= 14 static_assert((std::is_integral::value), ""); static_assert((std::is_signed::value), ""); +#endif } diff --git a/test/std/depr/depr.ios.members/streampos.pass.cpp b/test/std/depr/depr.ios.members/streampos.pass.cpp index 315118cb..863905f7 100644 --- a/test/std/depr/depr.ios.members/streampos.pass.cpp +++ b/test/std/depr/depr.ios.members/streampos.pass.cpp @@ -15,10 +15,15 @@ // typedef POS_T streampos; // }; +// These members were removed for C++17 + +#include "test_macros.h" #include #include int main() { +#if TEST_STD_VER <= 14 static_assert((std::is_same::value), ""); +#endif } diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html index ce5afd8e..73d8a1cb 100644 --- a/www/cxx1z_status.html +++ b/www/cxx1z_status.html @@ -70,7 +70,7 @@ N4366LWGLWG 2228 missing SFINAE ruleLenexaComplete3.1 N4510LWGMinimal incomplete type support for standard containers, revision 4LenexaComplete3.6 - P0004R1LWGRemove Deprecated iostreams aliases.Kona + P0004R1LWGRemove Deprecated iostreams aliases.KonaComplete3.8 P0006R0LWGAdopt Type Traits Variable Templates for C++17.KonaIn progress P0092R1LWGPolishing <chrono>Kona P0007R1LWGConstant View: A proposal for a std::as_const helper function template.KonaIn progress