Define __cpp_lib_byte feature-test macro
authorJonathan Wakely <jwakely@redhat.com>
Fri, 20 Oct 2017 18:02:19 +0000 (19:02 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 20 Oct 2017 18:02:19 +0000 (19:02 +0100)
* include/c_global/cstddef: Define __cpp_lib_byte feature-test macro.
* testsuite/18_support/byte/requirements.cc: Check macro.

From-SVN: r253952

libstdc++-v3/ChangeLog
libstdc++-v3/include/c_global/cstddef
libstdc++-v3/testsuite/18_support/byte/requirements.cc

index ba43a4b37083cb98061b21e0cae56963188b0733..179361d9223e27d82bef5e2ea57196212e4654c2 100644 (file)
@@ -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>
 
        * testsuite/experimental/filesystem/iterators/
index 09754ee45da45cb90ea637aea72424e1104b46fc..11d268b7f812a27ea0d02309df8296e5a47b0540 100644 (file)
@@ -57,9 +57,11 @@ namespace std
 }
 #endif
 
-#if __cplusplus > 201402L
+#if __cplusplus >= 201703L
 namespace std
 {
+#define __cpp_lib_byte 201603
+
   /// std::byte
   enum class byte : unsigned char {};
 
index 4cb05df04057ea1c650da37118c04128d266fc37..74c8b64d6cebbb1d086cfca19180a5814802e8ce 100644 (file)
 
 #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( alignof(std::byte) == alignof(unsigned char) );