https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119517
Bug ID: 119517 Summary: formatter for chrono types are underconstrained Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: tkaminsk at gcc dot gnu.org Target Milestone: --- The parse and format methods on the formatters for chrono types, currently accept unconstrained types as template parameter. This in combination with lack of requirements on CharT, leads to situation when formattable<Chrono, Any> is satisfied for std::chrono type Chrono and any type Any. As illustration following static assert passes: static_assert(std::formattable<std::chrono::weekday, int>); static_assert(std::formattable<std::chrono::sys_days, int>); static_assert(std::formattable<std::chrono::weekday, char16_t>); static_assert(std::formattable<std::chrono::sys_days, char16_t>); // https://godbolt.org/z/oYsY3EqrY The standard does not specify signatures for these functions, instead of specifies that enabled specialization for such types are provided. This implies that parse method needs to be valid basic_format_parse_context<CharT> and format need to acccept basic_format_context<Out, CharT> for any Out.