https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119135
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:925a744efec5a630eb9bf49e755c554a884fda99 commit r14-11446-g925a744efec5a630eb9bf49e755c554a884fda99 Author: Patrick Palka <ppa...@redhat.com> Date: Thu Mar 13 09:15:21 2025 -0400 libstdc++: Fix ref_view branch of views::as_const [PR119135] Unlike for span<X> and empty_view<X>, the range_reference_t of ref_view<X> doesn't correspond to X. This patch fixes the ref_view branch of views::as_const to correctly query its underlying range type X. PR libstdc++/119135 libstdc++-v3/ChangeLog: * include/std/ranges: Include <utility>. (views::__detail::__is_ref_view): Replace with ... (views::__detail::__is_constable_ref_view): ... this. (views::_AsConst::operator()): Replace bogus use of element_type in the ref_view branch. * testsuite/std/ranges/adaptors/as_const/1.cc (test03): Extend test. Reviewed-by: Tomasz KamiÅski <tkami...@redhat.com> Reviewed-by: Jonathan Wakely <jwak...@redhat.com> (cherry picked from commit 50359c0a44381edb6dbd9359ef2ebdadbcc3ed42)