]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Set feature test macro for complete C++23 mdspan [PR107761].
authorLuc Grosheintz <luc.grosheintz@gmail.com>
Tue, 8 Jul 2025 08:24:27 +0000 (10:24 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Tue, 8 Jul 2025 13:35:41 +0000 (15:35 +0200)
PR libstdc++/107761

libstdc++-v3/ChangeLog:

* include/bits/version.def (mdspan): Set to 202207 and remove
no_stdname.
* include/bits/version.h: Regenerate.
* testsuite/23_containers/mdspan/version.cc: Test presence
of feature test macro.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/testsuite/23_containers/mdspan/version.cc [new file with mode: 0644]

index 64f8190d240b771a9c8f348bb0df6b9609f3a817..f1015abdbfaed68f23fd50ea86ec4e926d2bf5a9 100644 (file)
@@ -1007,9 +1007,8 @@ ftms = {
 
 ftms = {
   name = mdspan;
-  no_stdname = true; // FIXME: remove
   values = {
-    v = 1; // FIXME: 202207
+    v = 202207;
     cxxmin = 23;
   };
 };
index 744246a9938af526ef4ec6075a48ffc985507aec..80f6586372d3a18daaacd7e3077596e7fe9ced1b 100644 (file)
 
 #if !defined(__cpp_lib_mdspan)
 # if (__cplusplus >= 202100L)
-#  define __glibcxx_mdspan 1L
+#  define __glibcxx_mdspan 202207L
 #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_mdspan)
+#   define __cpp_lib_mdspan 202207L
 #  endif
 # endif
 #endif /* !defined(__cpp_lib_mdspan) && defined(__glibcxx_want_mdspan) */
diff --git a/libstdc++-v3/testsuite/23_containers/mdspan/version.cc b/libstdc++-v3/testsuite/23_containers/mdspan/version.cc
new file mode 100644 (file)
index 0000000..106ee40
--- /dev/null
@@ -0,0 +1,9 @@
+// { dg-do compile { target c++23 } }
+#include <mdspan>
+
+#ifndef __cpp_lib_mdspan
+#error "Feature test macro __cpp_lib_mdspan is missing for <mdspan>"
+#if __cpp_lib_mdspan < 202207
+#error "Feature test macro __cpp_lib_mdspan has the wrong value"
+#endif
+#endif