[PATCH v4 6/6] libstdc++: Set FMT for complete C++23 mdspan [PR107761].
Tomasz Kaminski
tkaminsk@redhat.com
Tue Jul 8 10:58:55 GMT 2025
On Tue, Jul 8, 2025 at 12:26 PM Luc Grosheintz <luc.grosheintz@gmail.com>
wrote:
>
> On 7/8/25 11:32, Jonathan Wakely wrote:
> > On Tue, 8 Jul 2025 at 09:27, 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.
> >
> > Please spell this out in full as "feature test macro", there's no need
> > to use an initialism that some people won't recognise. (And the commit
> > summary line says "FMT" not "FTM" anyway ;-)
> >
> > I would also prefer the test to be called version.cc not ftm.cc as
> > that's what we use elsewhere.
> >
> > I think we can do that when pushing the commit though, we don't need
> > another patch for it.
> >
> > Thanks for getting <mdspan> done! Great work.
>
Same for me here: Thank you! This was a really huge amount of work.
>
> I never thought of it that way: spell it out to prevent
> typos.
>
> Thank you for fixing up the mistake when committing the
> patches. It's been a nice experience contributing to
> libstdc++! Thank you for the patience and thorough &
> friendly reviews.
>
Glad to hear that.
>
> I'll continue with the C++26 parts: padded layouts, sub-
> mdspan, etc.
>
Sounds good. Alternatively, looking into optimizing layouts before getting
submdspan also sounds reasonable. For submdspan we should also look into:
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r1.html
>
>
> >
> >>
> >> Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
> >> ---
> >> 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/96e940f2/attachment-0001.htm>
More information about the Libstdc++
mailing list