[PATCH v4 6/6] libstdc++: Set FMT for complete C++23 mdspan [PR107761].
Tomasz Kaminski
tkaminsk@redhat.com
Tue Jul 8 08:34:12 GMT 2025
On Tue, Jul 8, 2025 at 10:26 AM Luc Grosheintz <luc.grosheintz@gmail.com>
wrote:
> 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/ftm.cc: Test presence
> of FTM.
>
> Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
> ---
>
LGTM.
> libstdc++-v3/include/bits/version.def | 3 +--
> libstdc++-v3/include/bits/version.h | 3 ++-
> libstdc++-v3/testsuite/23_containers/mdspan/ftm.cc | 9 +++++++++
> 3 files changed, 12 insertions(+), 3 deletions(-)
> create mode 100644 libstdc++-v3/testsuite/23_containers/mdspan/ftm.cc
>
> diff --git a/libstdc++-v3/include/bits/version.def
> b/libstdc++-v3/include/bits/version.def
> index 64f8190d240..f1015abdbfa 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 744246a9938..80f6586372d 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/ftm.cc
> b/libstdc++-v3/testsuite/23_containers/mdspan/ftm.cc
> new file mode 100644
> index 00000000000..106ee4010ee
> --- /dev/null
> +++ b/libstdc++-v3/testsuite/23_containers/mdspan/ftm.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
> --
> 2.49.0
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20250708/e6e1eeb1/attachment.htm>
More information about the Libstdc++
mailing list