[PATCH] libstdc++: Update __cpp_lib_function_ref value for P3948R1.

Jonathan Wakely jwakely@redhat.com
Mon Apr 13 09:27:32 GMT 2026


OK

On Wed, 8 Apr 2026 at 17:04, Nathan Myers <ncm@cantrip.org> wrote:
>
> LGTM
>
> On 4/8/26 11:43 AM, Tomasz Kamiński wrote:
> > SG-10 agreed on using 202604L value for paper P3961R0 that
> > also updates __cpp_lib_function_ref macro.
> >
> > libstdc++-v3/ChangeLog:
> >
> >       * include/bits/version.def (function_ref): Bump to 202603L.
> >       * include/bits/version.h: Regenerate.
> >       * testsuite/20_util/function_ref/assign.cc: Remove repeated
> >       check for feature test macro.
> >       * testsuite/20_util/function_ref/cons.cc: Updated checked
> >       value.
> > ---
> > Lightly tested on x86_64-linux. OK for trunk?
> >
> >
> >   libstdc++-v3/include/bits/version.def                 | 5 ++++-
> >   libstdc++-v3/include/bits/version.h                   | 4 ++--
> >   libstdc++-v3/testsuite/20_util/function_ref/assign.cc | 6 ------
> >   libstdc++-v3/testsuite/20_util/function_ref/cons.cc   | 2 +-
> >   4 files changed, 7 insertions(+), 10 deletions(-)
> >
> > diff --git a/libstdc++-v3/include/bits/version.def b/libstdc++-v3/include/bits/version.def
> > index f5d1ee5c3ac..a918485a846 100644
> > --- a/libstdc++-v3/include/bits/version.def
> > +++ b/libstdc++-v3/include/bits/version.def
> > @@ -1961,9 +1961,12 @@ ftms = {
> >   };
> >
> >   ftms = {
> > +  // 202306 P0792R14 function_ref: a non-owning reference to a Callable
> > +  // 202511 P3774R1  Rename std::nontype, and make it broadly useful
> > +  // 202603 P3948R1  constant_wrapper is the only tool needed for passing...
> >     name = function_ref;
> >     values = {
> > -    v = 202306;
> > +    v = 202603;
> >       cxxmin = 26;
> >     };
> >   };
> > diff --git a/libstdc++-v3/include/bits/version.h b/libstdc++-v3/include/bits/version.h
> > index 086cf69041e..c6a5a6fd419 100644
> > --- a/libstdc++-v3/include/bits/version.h
> > +++ b/libstdc++-v3/include/bits/version.h
> > @@ -2183,9 +2183,9 @@
> >
> >   #if !defined(__cpp_lib_function_ref)
> >   # if (__cplusplus >  202302L)
> > -#  define __glibcxx_function_ref 202306L
> > +#  define __glibcxx_function_ref 202603L
> >   #  if defined(__glibcxx_want_all) || defined(__glibcxx_want_function_ref)
> > -#   define __cpp_lib_function_ref 202306L
> > +#   define __cpp_lib_function_ref 202603L
> >   #  endif
> >   # endif
> >   #endif /* !defined(__cpp_lib_function_ref) */
> > diff --git a/libstdc++-v3/testsuite/20_util/function_ref/assign.cc b/libstdc++-v3/testsuite/20_util/function_ref/assign.cc
> > index 9b02dc49c2a..ac96cecb477 100644
> > --- a/libstdc++-v3/testsuite/20_util/function_ref/assign.cc
> > +++ b/libstdc++-v3/testsuite/20_util/function_ref/assign.cc
> > @@ -2,12 +2,6 @@
> >
> >   #include <functional>
> >
> > -#ifndef __cpp_lib_function_ref
> > -# error "Feature-test macro for function_ref missing in <functional>"
> > -#elif __cpp_lib_function_ref != 202306L
> > -# error "Feature-test macro for function_ref has wrong value in <functional>"
> > -#endif
> > -
> >   using std::nontype;
> >   using std::nontype_t;
> >   using std::function_ref;
> > diff --git a/libstdc++-v3/testsuite/20_util/function_ref/cons.cc b/libstdc++-v3/testsuite/20_util/function_ref/cons.cc
> > index a91f5ba3dab..d2c097c6361 100644
> > --- a/libstdc++-v3/testsuite/20_util/function_ref/cons.cc
> > +++ b/libstdc++-v3/testsuite/20_util/function_ref/cons.cc
> > @@ -5,7 +5,7 @@
> >
> >   #ifndef __cpp_lib_function_ref
> >   # error "Feature-test macro for function_ref missing in <functional>"
> > -#elif __cpp_lib_function_ref != 202306L
> > +#elif __cpp_lib_function_ref != 202603L
> >   # error "Feature-test macro for function_ref has wrong value in <functional>"
> >   #endif
> >
>



More information about the Libstdc++ mailing list