https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119517
--- Comment #3 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:5f2078ca11843e3fe506c2fb72b9260a3cb9853e commit r15-9061-g5f2078ca11843e3fe506c2fb72b9260a3cb9853e Author: Tomasz KamiÅski <tkami...@redhat.com> Date: Fri Mar 28 16:17:18 2025 +0100 libstdc++: Constrain formatters for chrono types [PR119517] The formatters for chrono types defined the parse/format methods as accepting unconstrained types, this in combination with lack of constrain on _CharT lead to them falsely satisfying formattable requirements for any type used as character. This patch adjust the fromatter<T, CharT>::parse signature to: constexpr typename basic_format_parse_context<_CharT>::iterator parse(basic_format_parse_context<_CharT>& __pc); And formatter<T, CharT>::format to: template<typename _Out> typename basic_format_context<_Out, _CharT>::iterator format(const T& __t, basic_format_context<_Out, _CharT>& __fc) const; Furthermore we _CharT with __format::__char (char or wchar_t), PR libstdc++/119517 libstdc++-v3/ChangeLog: * include/bits/chrono_io.h (formatter): Add __format::__char for _CharT and adjust parse and format method signatures. * testsuite/std/time/format/pr119517.cc: New test. Reviewed-by: Jonathan Wakely <jwak...@redhat.com> Signed-off-by: Tomasz KamiÅski <tkami...@redhat.com>