https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109162
--- Comment #14 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tomasz Kaminski <tkami...@gcc.gnu.org>: https://gcc.gnu.org/g:843b273c6851b71407b116584982b0389be4d6fd commit r15-9547-g843b273c6851b71407b116584982b0389be4d6fd Author: Tomasz KamiÅski <tkami...@redhat.com> Date: Wed Apr 16 15:28:46 2025 +0200 libstdc++: Remove dead code in range_formatter::format [PR109162] Because the _M_format(__rg, __fc) were placed outside of if constexpr, these method and its children where instantiated, even if _M_format<const _Range> could be used. To simplify the if constexpr chain, we introduce a __simply_formattable_range (name based on simple-view) exposition only concept, that checks if range is const and mutable formattable and uses same formatter specialization for references in each case. PR libstdc++/109162 libstdc++-v3/ChangeLog: * include/std/format (__format::__simply_formattable_range): Define. (range_formatter::format): Do not instantiate _M_format for mutable _Rg if const _Rg can be used. Reviewed-by: Jonathan Wakely <jwak...@redhat.com> Signed-off-by: Tomasz KamiÅski <tkami...@redhat.com>