]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Relocate std::endian from <type_traits> to <bit>
authorJonathan Wakely <jwakely@redhat.com>
Fri, 26 Jul 2019 13:36:56 +0000 (14:36 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 26 Jul 2019 13:36:56 +0000 (14:36 +0100)
This change to an early C++2a feature was just approved (P1612R1).

Backport from mainline
2019-07-25  Jonathan Wakely  <jwakely@redhat.com>

* include/std/bit (endian): Move definition here as per P1612R1.
* include/std/type_traits (endian): Remove definition from here.
* testsuite/20_util/endian/1.cc: Rename to ...
* testsuite/26_numerics/endian/1.cc: ... here. Adjust header.

From-SVN: r273837

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/bit
libstdc++-v3/include/std/type_traits
libstdc++-v3/testsuite/26_numerics/endian/1.cc [moved from libstdc++-v3/testsuite/20_util/endian/1.cc with 98% similarity]

index 4a26702402531e11e2d8aeba014cabe36944b8f2..68490bff76c0877cebc12781398a9c4b6e26f99f 100644 (file)
@@ -1,3 +1,13 @@
+2019-07-26  Jonathan Wakely  <jwakely@redhat.com>
+
+       Backport from mainline
+       2019-07-25  Jonathan Wakely  <jwakely@redhat.com>
+
+       * include/std/bit (endian): Move definition here as per P1612R1.
+       * include/std/type_traits (endian): Remove definition from here.
+       * testsuite/20_util/endian/1.cc: Rename to ...
+       * testsuite/26_numerics/endian/1.cc: ... here. Adjust header.
+
 2019-07-26  Jonathan Wakely  <jwakely@redhat.com>
 
        Backport from mainline
index 417aa4a88d799c50af694308f2f308508806223c..4331255f157d94741562c05e955c7000360d3697 100644 (file)
@@ -325,6 +325,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     log2p1(_Tp __x) noexcept
     { return std::__log2p1(__x); }
 
+  /// Byte order
+  enum class endian
+  {
+    little = __ORDER_LITTLE_ENDIAN__,
+    big    = __ORDER_BIG_ENDIAN__,
+    native = __BYTE_ORDER__
+  };
 #endif // C++2a
 
 _GLIBCXX_END_NAMESPACE_VERSION
index cc9cb2467a968adc4d8414c5380c9b9d9a9de84f..440813dcf764b0c601eb9278e45794108ee6889a 100644 (file)
@@ -2992,14 +2992,6 @@ template <typename _From, typename _To>
 #endif // C++17
 
 #if __cplusplus > 201703L
-  /// Byte order
-  enum class endian
-  {
-    little = __ORDER_LITTLE_ENDIAN__,
-    big    = __ORDER_BIG_ENDIAN__,
-    native = __BYTE_ORDER__
-  };
-
   /// Remove references and cv-qualifiers.
   template<typename _Tp>
     struct remove_cvref
similarity index 98%
rename from libstdc++-v3/testsuite/20_util/endian/1.cc
rename to libstdc++-v3/testsuite/26_numerics/endian/1.cc
index 4faaba8e541e207b2800864e66835be99c8fdc0c..896a14c5a6c48845fb2b0c6619a656619dbadf6f 100644 (file)
@@ -18,7 +18,7 @@
 // { dg-options "-std=gnu++2a" }
 // { dg-do compile { target c++2a } }
 
-#include <type_traits>
+#include <bit>
 
 static_assert( std::is_enum_v<std::endian> );
 static_assert( std::endian::little != std::endian::big );