2020-04-23 Jonathan Wakely <jwakely@redhat.com>
+ * include/bits/stl_iterator.h (__cpp_lib_array_constexpr): Revert
+ value for C++17 to 201803L because P0858R0 is supported for C++17.
+ * include/std/version (__cpp_lib_array_constexpr): Likewise.
+ * testsuite/23_containers/array/element_access/constexpr_c++17.cc:
+ Check for value corresponding to P0031R0 features being tested.
+ * testsuite/23_containers/array/requirements/constexpr_iter.cc:
+ Check for value corresponding to P0858R0 features being tested.
+
* include/std/version (__cpp_lib_three_way_comparison): Define for
freestanding builds.
#if __cplusplus > 201703L
# define __cpp_lib_array_constexpr 201811L
#elif __cplusplus == 201703L
-# define __cpp_lib_array_constexpr 201603L
+# define __cpp_lib_array_constexpr 201803L
#endif
#if __cplusplus > 201703L
#if _GLIBCXX_HOSTED
#define __cpp_lib_any 201606L
#define __cpp_lib_apply 201603
-#define __cpp_lib_array_constexpr 201603L
+#define __cpp_lib_array_constexpr 201803L
#define __cpp_lib_as_const 201510
#define __cpp_lib_boyer_moore_searcher 201603
#define __cpp_lib_chrono 201611
# error "Feature test macro for array constexpr is missing in <array>"
#elif __cpp_lib_array_constexpr < 201603L
# error "Feature test macro for array constexpr has wrong value in <array>"
-#elif __cpp_lib_array_constexpr > 201603L && __cplusplus == 201703
-# error "Feature test macro for array constexpr has wrong value for C++17"
#endif
constexpr std::size_t test01()
#ifndef __cpp_lib_array_constexpr
# error "Feature test macro for array constexpr is missing in <array>"
-#elif __cpp_lib_array_constexpr < 201603L
+#elif __cpp_lib_array_constexpr < 201803L
# error "Feature test macro for array constexpr has wrong value in <array>"
-#elif __cpp_lib_array_constexpr > 201603L && __cplusplus == 201703
-# error "Feature test macro for array constexpr has wrong value for C++17"
#endif
+// This test is compiled as C++17 because array::iterator is just a pointer,
+// so always meets the C++20 constexpr iterator requirements, even in C++17.
+
constexpr int
test()
{