On 06/03/19 12:13 +0000, Jonathan Wakely wrote:
* include/std/type_traits [C++20] (is_bounded_array) (is_unbounded_array, is_bounded_array_v, is_unbounded_array_v): Define. * testsuite/20_util/is_bounded_array/requirements/ explicit_instantiation.cc: New test. * testsuite/20_util/is_bounded_array/requirements/typedefs.cc: New test. * testsuite/20_util/is_bounded_array/value.cc: New test. * testsuite/20_util/is_unbounded_array/requirements/ explicit_instantiation.cc: New test. * testsuite/20_util/is_unbounded_array/requirements/typedefs.cc: New * test. * testsuite/20_util/is_unbounded_array/value.cc: New test.
I forgot the feature test macro. I'll commit this after testing ...
commit 1d2785fd303eaf89daea9aff31d6164e75ff7e22 Author: Jonathan Wakely <jwak...@redhat.com> Date: Wed Mar 6 12:28:00 2019 +0000 Add feature test macro for bounded array traits * 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. diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index a1161d50399..c3cb67a457d 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -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 diff --git a/libstdc++-v3/include/std/version b/libstdc++-v3/include/std/version index 785e8966dbf..668b477e24d 100644 --- a/libstdc++-v3/include/std/version +++ b/libstdc++-v3/include/std/version @@ -148,6 +148,7 @@ #if __cplusplus > 201703L // c++2a +#define __cpp_lib_bounded_array_traits 201902L #if __cpp_impl_destroying_delete # define __cpp_lib_destroying_delete 201806L #endif diff --git a/libstdc++-v3/testsuite/20_util/is_bounded_array/value.cc b/libstdc++-v3/testsuite/20_util/is_bounded_array/value.cc index 9f37d36e532..47ecae8ca05 100644 --- a/libstdc++-v3/testsuite/20_util/is_bounded_array/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_bounded_array/value.cc @@ -21,6 +21,12 @@ #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; diff --git a/libstdc++-v3/testsuite/20_util/is_unbounded_array/value.cc b/libstdc++-v3/testsuite/20_util/is_unbounded_array/value.cc index 28a77b21da2..19fb0524cd8 100644 --- a/libstdc++-v3/testsuite/20_util/is_unbounded_array/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_unbounded_array/value.cc @@ -21,6 +21,12 @@ #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;