[gcc r16-2100] libstdc++: Set feature test macro for complete C++23 mdspan [PR107761].
Tomasz Kaminski
tkaminsk@gcc.gnu.org
Tue Jul 8 13:41:41 GMT 2025
https://gcc.gnu.org/g:7b3b315e4803e248a9083e99acf6ef3a2b21a6ee
commit r16-2100-g7b3b315e4803e248a9083e99acf6ef3a2b21a6ee
Author: Luc Grosheintz <luc.grosheintz@gmail.com>
Date: Tue Jul 8 10:24:27 2025 +0200
libstdc++: Set feature test macro for complete C++23 mdspan [PR107761].
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>
Diff:
---
libstdc++-v3/include/bits/version.def | 3 +--
libstdc++-v3/include/bits/version.h | 3 ++-
libstdc++-v3/testsuite/23_containers/mdspan/version.cc | 9 +++++++++
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def
index 64f8190d240b..f1015abdbfae 100644
--- a/libstdc++-v3/include/bits/version.def
+++ b/libstdc++-v3/include/bits/version.def
@@ -1007,9 +1007,8 @@ ftms = {
ftms = {
name = mdspan;
- no_stdname = true; // FIXME: remove
values = {
- v = 1; // FIXME: 202207
+ v = 202207;
cxxmin = 23;
};
};
diff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h
index 744246a9938a..80f6586372d3 100644
--- a/libstdc++-v3/include/bits/version.h
+++ b/libstdc++-v3/include/bits/version.h
@@ -1126,8 +1126,9 @@
#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
index 000000000000..106ee4010ee6
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/mdspan/version.cc
@@ -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
More information about the Libstdc++-cvs
mailing list