Add feature test macro for bounded array traits
authorJonathan Wakely <jwakely@redhat.com>
Wed, 6 Mar 2019 15:31:06 +0000 (15:31 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 6 Mar 2019 15:31:06 +0000 (15:31 +0000)
* include/std/type_traits (__cpp_lib_bounded_array_traits): Define.
* include/std/version (__cpp_lib_bounded_array_traits): Likewise.
* testsuite/20_util/is_bounded_array/value.cc: Check for macro.
* testsuite/20_util/is_unbounded_array/value.cc: Likewise.

From-SVN: r269426

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/type_traits
libstdc++-v3/include/std/version
libstdc++-v3/testsuite/20_util/is_bounded_array/value.cc
libstdc++-v3/testsuite/20_util/is_unbounded_array/value.cc

index 4cbdc80aa08d470cd31bffcebd1eae4c5409f6be..2559fa3c1ecd30517de9ab88950d0ba2d95ac8c8 100644 (file)
@@ -1,3 +1,10 @@
+2019-03-06  Jonathan Wakely  <jwakely@redhat.com>
+
+       * include/std/type_traits (__cpp_lib_bounded_array_traits): Define.
+       * include/std/version (__cpp_lib_bounded_array_traits): Likewise.
+       * testsuite/20_util/is_bounded_array/value.cc: Check for macro.
+       * testsuite/20_util/is_unbounded_array/value.cc: Likewise.
+
 2019-03-06  Edward Smith-Rowland  <3dw4rd@verizon.net>
 
        PR libstdc++/86655 - std::assoc_legendre should not constrain
index a1161d50399320bc66975f3d62d2c1fd28e1463f..c3cb67a457dbba7510ed49e2d93eb769985b7cce 100644 (file)
@@ -3074,6 +3074,8 @@ template <typename _From, typename _To>
   template<typename _Tp>
     using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type;
 
+#define __cpp_lib_bounded_array_traits 201902L
+
   /// True for a type that is an array of known bound.
   template<typename _Tp>
     struct is_bounded_array
index 785e8966dbfcd62c08e5ec445ef5dab4910765e0..668b477e24dfcdf2e543982fb261a67fe020f10b 100644 (file)
 
 #if __cplusplus > 201703L
 // c++2a
+#define __cpp_lib_bounded_array_traits 201902L
 #if __cpp_impl_destroying_delete
 # define __cpp_lib_destroying_delete 201806L
 #endif
index 9f37d36e53216fa8fc89896a60c7256da43906d7..47ecae8ca05df1350a1a2dde395e10222a1e5d63 100644 (file)
 #include <type_traits>
 #include <testsuite_tr1.h>
 
+#ifndef __cpp_lib_bounded_array_traits
+# error "Feature test macro for is_bounded_array is missing"
+#elif __cpp_lib_bounded_array_traits < 201902L
+# error "Feature test macro for is_bounded_array has wrong value"
+#endif
+
 void test01()
 {
   using std::is_bounded_array;
index 28a77b21da213205c520d5b618101ef82d9b1cc5..19fb0524cd850032de3b6524c4fe4d43eb999030 100644 (file)
 #include <type_traits>
 #include <testsuite_tr1.h>
 
+#ifndef __cpp_lib_bounded_array_traits
+# error "Feature test macro for is_unbounded_array is missing"
+#elif __cpp_lib_bounded_array_traits < 201902L
+# error "Feature test macro for is_unbounded_array has wrong value"
+#endif
+
 void test01()
 {
   using std::is_unbounded_array;