mirror of git://gcc.gnu.org/git/gcc.git
Define __cpp_lib_byte feature-test macro
* include/c_global/cstddef: Define __cpp_lib_byte feature-test macro. * testsuite/18_support/byte/requirements.cc: Check macro. From-SVN: r253952
This commit is contained in:
parent
b0926447b5
commit
253e8d2150
|
|
@ -1,3 +1,8 @@
|
||||||
|
2017-10-20 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
* include/c_global/cstddef: Define __cpp_lib_byte feature-test macro.
|
||||||
|
* testsuite/18_support/byte/requirements.cc: Check macro.
|
||||||
|
|
||||||
2017-10-19 Jonathan Wakely <jwakely@redhat.com>
|
2017-10-19 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
* testsuite/experimental/filesystem/iterators/
|
* testsuite/experimental/filesystem/iterators/
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,11 @@ namespace std
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __cplusplus > 201402L
|
#if __cplusplus >= 201703L
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
|
#define __cpp_lib_byte 201603
|
||||||
|
|
||||||
/// std::byte
|
/// std::byte
|
||||||
enum class byte : unsigned char {};
|
enum class byte : unsigned char {};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,12 @@
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
|
#ifndef __cpp_lib_byte
|
||||||
|
# error "Feature-test macro for byte missing"
|
||||||
|
#elif __cpp_lib_byte != 201603
|
||||||
|
# error "Feature-test macro for byte has wrong value"
|
||||||
|
#endif
|
||||||
|
|
||||||
static_assert( sizeof(std::byte) == sizeof(unsigned char) );
|
static_assert( sizeof(std::byte) == sizeof(unsigned char) );
|
||||||
static_assert( alignof(std::byte) == alignof(unsigned char) );
|
static_assert( alignof(std::byte) == alignof(unsigned char) );
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue