mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-13 21:01:29 +08:00
Relocate std::endian from <type_traits> to <bit>
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
This commit is contained in:
parent
599780d601
commit
45c7215c1e
@ -1,3 +1,10 @@
|
||||
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>
|
||||
|
||||
|
@ -315,6 +315,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
|
||||
|
@ -3226,14 +3226,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
|
||||
|
@ -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 );
|
Loading…
x
Reference in New Issue
Block a user