On Tue, Jul 8, 2025 at 11:34 AM Jonathan Wakely <jwak...@redhat.com> wrote:

> On Tue, 8 Jul 2025 at 09:27, Luc Grosheintz <luc.groshei...@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 am also renaming the test file for ftm.cc to version.cc.

>
> 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.
>
> >
> > Signed-off-by: Luc Grosheintz <luc.groshei...@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
> >
>
>

Reply via email to