[libcxx] r251618 - Implement P0004R1 'Remove Deprecated iostreams aliases'

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 28 22:43:31 PDT 2015


Author: marshall
Date: Thu Oct 29 00:43:30 2015
New Revision: 251618

URL: http://llvm.org/viewvc/llvm-project?rev=251618&view=rev
Log:
Implement P0004R1 'Remove Deprecated iostreams aliases'

Modified:
    libcxx/trunk/include/ios
    libcxx/trunk/test/std/depr/depr.ios.members/io_state.pass.cpp
    libcxx/trunk/test/std/depr/depr.ios.members/open_mode.pass.cpp
    libcxx/trunk/test/std/depr/depr.ios.members/seek_dir.pass.cpp
    libcxx/trunk/test/std/depr/depr.ios.members/streamoff.pass.cpp
    libcxx/trunk/test/std/depr/depr.ios.members/streampos.pass.cpp
    libcxx/trunk/www/cxx1z_status.html

Modified: libcxx/trunk/include/ios
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/ios?rev=251618&r1=251617&r2=251618&view=diff
==============================================================================
--- libcxx/trunk/include/ios (original)
+++ libcxx/trunk/include/ios Thu Oct 29 00:43:30 2015
@@ -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;
 

Modified: libcxx/trunk/test/std/depr/depr.ios.members/io_state.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.ios.members/io_state.pass.cpp?rev=251618&r1=251617&r2=251618&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.ios.members/io_state.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.ios.members/io_state.pass.cpp Thu Oct 29 00:43:30 2015
@@ -15,11 +15,16 @@
 //     typedef T1 io_state;
 // };
 
+//  These members were removed for C++17
+
+#include "test_macros.h"
 #include <strstream>
 #include <cassert>
 
 int main()
 {
+#if TEST_STD_VER <= 14
     std::strstream::io_state b = std::strstream::eofbit;
     assert(b == std::ios::eofbit);
+#endif
 }

Modified: libcxx/trunk/test/std/depr/depr.ios.members/open_mode.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.ios.members/open_mode.pass.cpp?rev=251618&r1=251617&r2=251618&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.ios.members/open_mode.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.ios.members/open_mode.pass.cpp Thu Oct 29 00:43:30 2015
@@ -15,11 +15,16 @@
 //     typedef T2 open_mode;
 // };
 
+//  These members were removed for C++17
+
+#include "test_macros.h"
 #include <strstream>
 #include <cassert>
 
 int main()
 {
+#if TEST_STD_VER <= 14
     std::strstream::open_mode b = std::strstream::app;
     assert(b == std::ios::app);
+#endif
 }

Modified: libcxx/trunk/test/std/depr/depr.ios.members/seek_dir.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.ios.members/seek_dir.pass.cpp?rev=251618&r1=251617&r2=251618&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.ios.members/seek_dir.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.ios.members/seek_dir.pass.cpp Thu Oct 29 00:43:30 2015
@@ -15,11 +15,16 @@
 //     typedef T3 seek_dir;
 // };
 
+//  These members were removed for C++17
+
+#include "test_macros.h"
 #include <strstream>
 #include <cassert>
 
 int main()
 {
+#if TEST_STD_VER <= 14
     std::strstream::seek_dir b = std::strstream::cur;
     assert(b == std::ios::cur);
+#endif
 }

Modified: libcxx/trunk/test/std/depr/depr.ios.members/streamoff.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.ios.members/streamoff.pass.cpp?rev=251618&r1=251617&r2=251618&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.ios.members/streamoff.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.ios.members/streamoff.pass.cpp Thu Oct 29 00:43:30 2015
@@ -15,11 +15,16 @@
 //     typedef OFF_T streamoff;
 // };
 
+//  These members were removed for C++17
+
+#include "test_macros.h"
 #include <ios>
 #include <type_traits>
 
 int main()
 {
+#if TEST_STD_VER <= 14
     static_assert((std::is_integral<std::ios_base::streamoff>::value), "");
     static_assert((std::is_signed<std::ios_base::streamoff>::value), "");
+#endif
 }

Modified: libcxx/trunk/test/std/depr/depr.ios.members/streampos.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.ios.members/streampos.pass.cpp?rev=251618&r1=251617&r2=251618&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.ios.members/streampos.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.ios.members/streampos.pass.cpp Thu Oct 29 00:43:30 2015
@@ -15,10 +15,15 @@
 //     typedef POS_T streampos;
 // };
 
+//  These members were removed for C++17
+
+#include "test_macros.h"
 #include <ios>
 #include <type_traits>
 
 int main()
 {
+#if TEST_STD_VER <= 14
     static_assert((std::is_same<std::ios_base::streampos, std::streampos>::value), "");
+#endif
 }

Modified: libcxx/trunk/www/cxx1z_status.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/cxx1z_status.html?rev=251618&r1=251617&r2=251618&view=diff
==============================================================================
--- libcxx/trunk/www/cxx1z_status.html (original)
+++ libcxx/trunk/www/cxx1z_status.html Thu Oct 29 00:43:30 2015
@@ -70,7 +70,7 @@
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4366">N4366</a></td><td>LWG</td></td><td>LWG 2228 missing SFINAE rule</td><td>Lenexa</td><td>Complete</td><td>3.1</td></tr>
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510">N4510</a></td><td>LWG</td></td><td>Minimal incomplete type support for standard containers, revision 4</td><td>Lenexa</td><td>Complete</td><td>3.6</td></tr>
   	<tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0004R1.html">P0004R1</a></td><td>LWG</td><td>Remove Deprecated iostreams aliases.</td><td>Kona</td><td></td><td></td></tr>
+	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0004R1.html">P0004R1</a></td><td>LWG</td><td>Remove Deprecated iostreams aliases.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0006R0.html">P0006R0</a></td><td>LWG</td><td>Adopt Type Traits Variable Templates for C++17.</td><td>Kona</td><td>In progress</td><td></td></tr>
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0092R1.html">P0092R1</a></td><td>LWG</td><td>Polishing <chrono></td><td>Kona</td><td></td><td></td></tr>
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0007R1.html">P0007R1</a></td><td>LWG</td><td>Constant View: A proposal for a <tt>std::as_const</tt> helper function template.</td><td>Kona</td><td>In progress</td><td></td></tr>




More information about the cfe-commits mailing list