]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Implement P4206R0: Revert string support in std::constant_wrapper. master trunk
authorTomasz Kamiński <tkaminsk@redhat.com>
Thu, 30 Apr 2026 18:07:14 +0000 (20:07 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Sat, 13 Jun 2026 20:13:26 +0000 (22:13 +0200)
commit4e3139439f9cda78f9ce9c079895d8d0f2dc2a0a
tree9360c69008493c91ee7ebff410b5cd558f10a8d0
parent3781bb37cf83b8a6849c626236e5023b9eb9fe12
libstdc++: Implement P4206R0: Revert string support in std::constant_wrapper.

We need to apply remove_cvref_t on decltype(_Xv) for default template argument
due PR115314. The constant_wrapper::value is declared as decltype((__Xv)) due
PR125188.

libstdc++-v3/ChangeLog:

* include/bits/version.def (constant_wrapper): Bump to 202606L.
* include/bits/version.h: Regenerate.
* include/bits/funcref_impl.h (function_ref::function_ref): Rename
template parameter from __cwfn to __fn and use it direclty.
* include/bits/funcwrap.h (function_ref): Rename template parameter
to __fn.
(std::constant_wrapper): Use auto as non-type template parameter,
and refeference it as value.
* include/bits/utility.h (__CwFixedValue): Remove.
* testsuite/20_util/constant_wrapper/generic.cc: Remove arrays
and string literal tests. Add test for address of value.
* testsuite/20_util/constant_wrapper/other_wrappers.cc:
Remove test_array.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
libstdc++-v3/include/bits/funcref_impl.h
libstdc++-v3/include/bits/funcwrap.h
libstdc++-v3/include/bits/utility.h
libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/testsuite/20_util/constant_wrapper/generic.cc
libstdc++-v3/testsuite/20_util/constant_wrapper/other_wrappers.cc
libstdc++-v3/testsuite/20_util/constant_wrapper/type_param_neg.cc [new file with mode: 0644]