]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_iter.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 23_containers / array / requirements / constexpr_iter.cc
index f3f9ae6ea41d0290398b83840049e0f5dad3cb9d..1fde3de4a07e6b488d8afaec4af66c6a04bcf7b3 100644 (file)
@@ -1,7 +1,7 @@
-// { dg-options "-std=gnu++2a" }
-// { dg-do compile { target c++2a } }
-//
-// Copyright (C) 2019-2020 Free Software Foundation, Inc.
+// { dg-do compile { target c++17 } }
+// { dg-add-options no_pch }
+
+// Copyright (C) 2019-2024 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 
 #include <array>
 
+#ifndef __cpp_lib_array_constexpr
+# error "Feature test macro for array constexpr is missing in <array>"
+#elif __cpp_lib_array_constexpr < 201803L
+# error "Feature test macro for array constexpr has wrong value in <array>"
+#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()
 {