This change to an early C++2a feature was just approved (P1612R1).
* 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: r273816
+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-25 Martin Liska <mliska@suse.cz>
Dominik Infuhr <dominik.infuehr@theobroma-systems.com>
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
#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
+++ /dev/null
-// Copyright (C) 2017-2019 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++2a" }
-// { dg-do compile { target c++2a } }
-
-#include <type_traits>
-
-static_assert( std::is_enum_v<std::endian> );
-static_assert( std::endian::little != std::endian::big );
-static_assert( std::endian::native == std::endian::big
- || std::endian::native == std::endian::little );
-
-namespace gnu {
- int little, big, native;
-}
-
-using namespace std;
-using namespace gnu;
-
-// std::endian is a scoped-enum so these should refer to gnu::native etc.
-int test = little + big + native;
--- /dev/null
+// Copyright (C) 2017-2019 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++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <bit>
+
+static_assert( std::is_enum_v<std::endian> );
+static_assert( std::endian::little != std::endian::big );
+static_assert( std::endian::native == std::endian::big
+ || std::endian::native == std::endian::little );
+
+namespace gnu {
+ int little, big, native;
+}
+
+using namespace std;
+using namespace gnu;
+
+// std::endian is a scoped-enum so these should refer to gnu::native etc.
+int test = little + big + native;