aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Grosheintz <luc.grosheintz@gmail.com>2025-07-08 10:24:27 +0200
committerTomasz Kamiński <tkaminsk@redhat.com>2025-07-08 15:35:41 +0200
commit7b3b315e4803e248a9083e99acf6ef3a2b21a6ee (patch)
treef9224500bebaae10b6f5fc402f9c10552ab55311
parent3fd638a9e5497dfdf00f1783d6e704af03fb44b0 (diff)
downloadgcc-7b3b315e4803e248a9083e99acf6ef3a2b21a6ee.zip
gcc-7b3b315e4803e248a9083e99acf6ef3a2b21a6ee.tar.gz
gcc-7b3b315e4803e248a9083e99acf6ef3a2b21a6ee.tar.bz2
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>
-rw-r--r--libstdc++-v3/include/bits/version.def3
-rw-r--r--libstdc++-v3/include/bits/version.h3
-rw-r--r--libstdc++-v3/testsuite/23_containers/mdspan/version.cc9
3 files changed, 12 insertions, 3 deletions
diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def
index 64f8190..f1015ab 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 744246a..80f6586 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 0000000..106ee40
--- /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