libstdc++: Use std::remove_cv_t in std::optional::transform [PR109340]
We need to strip cv-qualifiers from the result of the callable passed to
std::optional::transform.
For std::expected::transform and std::expected::transform_error I
noticed we were stripping cv-qualifiers but were also incorrectly
stripping references.
libstdc++-v3/ChangeLog:
PR libstdc++/109340
* include/std/expected (expected::transform): Use
std::remove_cv_t instead of std::remove_cvref_t.
(expected::transform_error): Likewise.
(expected<cv void, E>::transform): Likewise.
(expected<cv void, E>::transform_error): Likewise.
* include/std/optional (transform): Use std::remove_cv_t.
* testsuite/20_util/optional/monadic/pr109340.cc: New test.