https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109242
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:82e8d1685a1e5fac4880e987ed9684248378bce2 commit r12-9369-g82e8d1685a1e5fac4880e987ed9684248378bce2 Author: Jonathan Wakely <jwak...@redhat.com> Date: Wed Mar 29 22:16:55 2023 +0100 libstdc++: Use std::remove_cv_t in std::optional::transform [PR109242] We need to strip cv-qualifiers from the result of the callable passed to std::optional::transform. libstdc++-v3/ChangeLog: PR libstdc++/109242 * include/std/optional (transform): Use std::remove_cv_t. * testsuite/20_util/optional/monadic/pr109242.cc: New test. (cherry picked from commit 31a909712014b75fc6ae2ca5eaa425f218bb5f32)