https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128830
Bug ID: 128830
Summary: Cannot format `std::filesystem::file_time_type`
without including `<chrono>`
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: davidfromonline at gmail dot com
Target Milestone: ---
The following code
```c++
#include <filesystem>
#include <format>
auto f(std::filesystem::file_time_type const t) -> void {
auto _ = std::format("{}", t);
}
```
causes gcc to fail with
```console
In file included from <source>:2:
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:
In instantiation of 'class std::__format::_Checking_scanner<char,
std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > > >':
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5686:4:
required from 'consteval std::basic_format_string<_CharT,
_Args>::basic_format_string(const _Tp&) [with _Tp = char [3]; _CharT = char;
_Args = {const std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >&}]'
5686 | __scanner(_M_str);
| ^~~~~~~~~
<source>:5:23: required from here
5 | auto _ = std::format("{}", t);
| ^~~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5486:10:
error: static assertion failed: std::formatter must be specialized for each
type being formatted
5486 | (is_default_constructible_v<formatter<_Args, _CharT>> && ...),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
• 'std::formatter<std::chrono::time_point<std::filesystem::__file_clock>,
char>' is not default constructible, because
• error: use of deleted function 'std::formatter<_Tp, _CharT>::formatter()
[with _Tp = std::chrono::time_point<std::filesystem::__file_clock>; _CharT =
char]'
• declared here
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:223:7:
223 | formatter() = delete; // No std::formatter specialization for
this type.
| ^~~~~~~~~
• use '-fdiagnostics-all-candidates' to display considered candidates
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5486:10:
5486 | (is_default_constructible_v<formatter<_Args, _CharT>> &&
...),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:
In instantiation of 'constexpr void std::__format::_Checking_scanner<_CharT,
_Args>::_M_parse_format_spec(std::size_t) [with _Tp =
std::chrono::time_point<std::filesystem::__file_clock>; _OtherArgs = {}; _CharT
= char; _Args = {std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >}; std::size_t =
long unsigned int]':
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5507:33:
required from here
5507 | _M_parse_format_spec<_Args...>(__id);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
<source>:5:23: in 'constexpr' expansion of 'std::basic_format_string<char,
const std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >&>("{}")'
5 | auto _ = std::format("{}", t);
| ^~~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5687:19:
in 'constexpr' expansion of '__scanner.std::__format::_Checking_scanner<char,
std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >
>::std::__format::_Scanner<char>.std::__format::_Scanner<char>::_M_scan()'
5687 | __scanner._M_scan();
| ~~~~~~~~~~~~~~~~~^~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5328:19:
in 'constexpr' expansion of
'((std::__format::_Scanner<char>*)this)->std::__format::_Scanner<char>::_M_format_arg(((std::__format::_Scanner<char>*)this)->std::__format::_Scanner<char>::_M_pc.std::basic_format_parse_context<char>::_Scan_parse_context::std::basic_format_parse_context<char>.std::basic_format_parse_context<char>::next_arg_id())'
5328 | _M_format_arg(_M_pc.next_arg_id());
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5520:38:
error: use of deleted function 'std::formatter<_Tp, _CharT>::formatter() [with
_Tp = std::chrono::time_point<std::filesystem::__file_clock>; _CharT = char]'
5520 | formatter<_Tp, _CharT> __f;
| ^~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:223:7:
note: declared here
223 | formatter() = delete; // No std::formatter specialization for
this type.
| ^~~~~~~~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5520:38:
note: use '-fdiagnostics-all-candidates' to display considered candidates
5520 | formatter<_Tp, _CharT> __f;
| ^~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5521:42:
error: 'struct
std::formatter<std::chrono::time_point<std::filesystem::__file_clock>, char>'
has no member named 'parse'
5521 | this->_M_pc.advance_to(__f.parse(this->_M_pc));
| ~~~~^~~~~
<source>: In function 'void f(std::filesystem::file_time_type)':
<source>:5:30: error: call to consteval function
'std::basic_format_string<char, const
std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >&>("{}")' is not a
constant expression
5 | auto _ = std::format("{}", t);
| ^~~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:
In instantiation of 'static std::__format::_Arg_store<_Context,
_Args>::_Element_t std::__format::_Arg_store<_Context,
_Args>::_S_make_elt(_Tp&) [with _Tp = const
std::chrono::time_point<std::filesystem::__file_clock>; _Context =
std::basic_format_context<std::__format::_Sink_iter<char>, char>; _Args =
{std::__format::_Arg_value<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >::handle}; _Element_t =
std::__conditional<true>::type<std::__format::_Arg_value<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >,
std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char> > >]':
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5126:23:
required from 'std::__format::_Arg_store<_Context, _Args>::_Arg_store(_Tp&
...) [with _Tp = {const std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >}; _Context =
std::basic_format_context<std::__format::_Sink_iter<char>, char>; _Args =
{std::__format::_Arg_value<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >::handle}]'
5126 | : _M_args{_S_make_elt(__a)...}
| ~~~~~~~~~~~^~~~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5176:14:
required from 'auto std::make_format_args(_Args& ...) [with _Context =
basic_format_context<__format::_Sink_iter<char>, char>; _Args = {const
chrono::time_point<filesystem::__file_clock, chrono::duration<long int,
ratio<1, 1000000000> > >}]'
5176 | return _Store(__fmt_args...);
| ^~~~~~~~~~~~~~~~~~~~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5770:61:
required from 'std::string std::format(format_string<_Args ...>, _Args&& ...)
[with _Args = {const chrono::time_point<filesystem::__file_clock,
chrono::duration<long int, ratio<1, 1000000000> > >&}; string =
__cxx11::basic_string<char>; format_string<_Args ...> =
basic_format_string<char, const chrono::time_point<filesystem::__file_clock,
chrono::duration<long int, ratio<1, 1000000000> > >&>]'
5770 | { return std::vformat(__fmt.get(),
std::make_format_args(__args...)); }
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
<source>:5:22: required from here
5 | auto _ = std::format("{}", t);
| ~~~~~~~~~~~^~~~~~~~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5103:25:
error: static assertion failed: std::formatter must be specialized for the type
of each format arg
5103 | static_assert(is_default_constructible_v<formatter<_Tq,
_CharT>>,
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
• 'std::formatter<std::chrono::time_point<std::filesystem::__file_clock>,
char>' is not default constructible, because
• error: use of deleted function 'std::formatter<_Tp, _CharT>::formatter()
[with _Tp = std::chrono::time_point<std::filesystem::__file_clock>; _CharT =
char]'
• declared here
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:223:7:
223 | formatter() = delete; // No std::formatter specialization for
this type.
| ^~~~~~~~~
• use '-fdiagnostics-all-candidates' to display considered candidates
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5103:25:
5103 | static_assert(is_default_constructible_v<formatter<_Tq,
_CharT>>,
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5114:38:
error: no matching function for call to
'std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >::basic_format_arg(const
std::chrono::time_point<std::filesystem::__file_clock>&)'
5114 | basic_format_arg<_Context> __arg(__v);
| ^~~~~
• there are 4 candidates
• candidate 1: 'template<class _Tp> requires __formattable_with<_Tp,
_Context, typename _Context::formatter_type<typename
std::remove_const<_Tq>::type>, std::basic_format_parse_context<typename
_Context::char_type> > std::basic_format_arg<_Context>::basic_format_arg(_Tp&)
[with _Context = std::basic_format_context<std::__format::_Sink_iter<char>,
char>]'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:4795:9:
4795 | basic_format_arg(_Tp& __v) noexcept
| ^~~~~~~~~~~~~~~~
• template argument deduction/substitution failed:
• constraints not satisfied
In file included from
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/compare:44,
from
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/bits/char_traits.h:58,
from
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/bits/iosfwd.h:40,
from
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/system_error:44,
from
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/bits/fs_fwd.h:35,
from
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/filesystem:54,
from <source>:1:
•
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/concepts:
In substitution of 'template<class _Tp> requires __formattable_with<_Tp,
_Context, typename _Context::formatter_type<typename
std::remove_const<_Tq>::type>, std::basic_format_parse_context<typename
_Context::char_type> >
std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >::basic_format_arg(_Tp&) [with _Tp = const
std::chrono::time_point<std::filesystem::__file_clock>]':
• required from 'static std::__format::_Arg_store<_Context,
_Args>::_Element_t std::__format::_Arg_store<_Context,
_Args>::_S_make_elt(_Tp&) [with _Tp = const
std::chrono::time_point<std::filesystem::__file_clock>; _Context =
std::basic_format_context<std::__format::_Sink_iter<char>, char>; _Args =
{std::__format::_Arg_value<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >::handle}; _Element_t =
std::__conditional<true>::type<std::__format::_Arg_value<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >,
std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char> > >]'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5114:31:
5114 | basic_format_arg<_Context> __arg(__v);
| ^~~~~
• required from 'std::__format::_Arg_store<_Context,
_Args>::_Arg_store(_Tp& ...) [with _Tp = {const
std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >}; _Context =
std::basic_format_context<std::__format::_Sink_iter<char>, char>; _Args =
{std::__format::_Arg_value<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >::handle}]'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5126:23:
5126 | : _M_args{_S_make_elt(__a)...}
| ~~~~~~~~~~~^~~~~
• required from 'auto std::make_format_args(_Args& ...) [with
_Context = basic_format_context<__format::_Sink_iter<char>, char>; _Args =
{const chrono::time_point<filesystem::__file_clock, chrono::duration<long int,
ratio<1, 1000000000> > >}]'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5176:14:
5176 | return _Store(__fmt_args...);
| ^~~~~~~~~~~~~~~~~~~~~
• required from 'std::string std::format(format_string<_Args ...>,
_Args&& ...) [with _Args = {const chrono::time_point<filesystem::__file_clock,
chrono::duration<long int, ratio<1, 1000000000> > >&}; string =
__cxx11::basic_string<char>; format_string<_Args ...> =
basic_format_string<char, const chrono::time_point<filesystem::__file_clock,
chrono::duration<long int, ratio<1, 1000000000> > >&>]'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5770:61:
5770 | { return std::vformat(__fmt.get(),
std::make_format_args(__args...)); }
|
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
• required from here
<source>:5:22:
5 | auto _ = std::format("{}", t);
| ~~~~~~~~~~~^~~~~~~~~
• required for the satisfaction of 'constructible_from<_Tp, _Tp>'
[with _Tp =
std::formatter<std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >, char>]
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/concepts:161:13:
161 | concept constructible_from
| ^~~~~~~~~~~~~~~~~~
• required for the satisfaction of 'move_constructible<_Tp>' [with
_Tp = std::formatter<std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >, char>]
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/concepts:175:13:
175 | concept move_constructible
| ^~~~~~~~~~~~~~~~~~
• required for the satisfaction of 'copy_constructible<_Tp>' [with
_Tp = std::formatter<std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >, char>]
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/concepts:180:13:
180 | concept copy_constructible
| ^~~~~~~~~~~~~~~~~~
• required for the satisfaction of 'copyable<_Tp>' [with _Tp =
std::formatter<std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >, char>]
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/concepts:277:13:
277 | concept copyable = copy_constructible<_Tp> &&
movable<_Tp>
| ^~~~~~~~
• required for the satisfaction of 'semiregular<_Formatter>' [with
_Formatter =
std::formatter<std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >, char>]
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/concepts:282:13:
282 | concept semiregular = copyable<_Tp> &&
default_initializable<_Tp>;
| ^~~~~~~~~~~
• required for the satisfaction of '__formattable_with<_Tp, _Context,
typename _Context::formatter_type<typename std::remove_const<_Tq>::type>,
std::basic_format_parse_context<typename _Context::char_type> >' [with _Tp =
const std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >; _Context =
std::basic_format_context<std::__format::_Sink_iter<char>, char>]
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/bits/formatfwd.h:101:13:
101 | concept __formattable_with
| ^~~~~~~~~~~~~~~~~~
• the expression 'is_constructible_v<_Tp, _Args ...> [with _Tp =
std::formatter<std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >, char>; _Args =
{std::formatter<std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >, char>}]'
evaluated to 'false'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/concepts:162:30:
162 | = destructible<_Tp> && is_constructible_v<_Tp,
_Args...>;
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
•
'std::formatter<std::chrono::time_point<std::filesystem::__file_clock>, char>'
is not constructible from
'std::formatter<std::chrono::time_point<std::filesystem::__file_clock>, char>',
because
• error: use of deleted function 'std::formatter<_Tp,
_CharT>::formatter(const std::formatter<_Tp, _CharT>&) [with _Tp =
std::chrono::time_point<std::filesystem::__file_clock>; _CharT = char]'
• declared here
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:224:7:
224 | formatter(const formatter&) = delete;
| ^~~~~~~~~
• use '-fdiagnostics-all-candidates' to display considered candidates
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/concepts:162:30:
162 | = destructible<_Tp> && is_constructible_v<_Tp,
_Args...>;
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
•
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:
In instantiation of 'static std::__format::_Arg_store<_Context,
_Args>::_Element_t std::__format::_Arg_store<_Context,
_Args>::_S_make_elt(_Tp&) [with _Tp = const
std::chrono::time_point<std::filesystem::__file_clock>; _Context =
std::basic_format_context<std::__format::_Sink_iter<char>, char>; _Args =
{std::__format::_Arg_value<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >::handle}; _Element_t =
std::__conditional<true>::type<std::__format::_Arg_value<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >,
std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char> > >]':
• required from 'std::__format::_Arg_store<_Context,
_Args>::_Arg_store(_Tp& ...) [with _Tp = {const
std::chrono::time_point<std::filesystem::__file_clock,
std::chrono::duration<long int, std::ratio<1, 1000000000> > >}; _Context =
std::basic_format_context<std::__format::_Sink_iter<char>, char>; _Args =
{std::__format::_Arg_value<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >::handle}]'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5126:23:
5126 | : _M_args{_S_make_elt(__a)...}
| ~~~~~~~~~~~^~~~~
• required from 'auto std::make_format_args(_Args& ...) [with _Context =
basic_format_context<__format::_Sink_iter<char>, char>; _Args = {const
chrono::time_point<filesystem::__file_clock, chrono::duration<long int,
ratio<1, 1000000000> > >}]'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5176:14:
5176 | return _Store(__fmt_args...);
| ^~~~~~~~~~~~~~~~~~~~~
• required from 'std::string std::format(format_string<_Args ...>, _Args&&
...) [with _Args = {const chrono::time_point<filesystem::__file_clock,
chrono::duration<long int, ratio<1, 1000000000> > >&}; string =
__cxx11::basic_string<char>; format_string<_Args ...> =
basic_format_string<char, const chrono::time_point<filesystem::__file_clock,
chrono::duration<long int, ratio<1, 1000000000> > >&>]'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:5770:61:
5770 | { return std::vformat(__fmt.get(),
std::make_format_args(__args...)); }
|
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
• required from here
<source>:5:22:
5 | auto _ = std::format("{}", t);
| ~~~~~~~~~~~^~~~~~~~~
• candidate 2: 'std::basic_format_arg<_Context>::basic_format_arg() [with
_Context = std::basic_format_context<std::__format::_Sink_iter<char>, char>]'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:4595:7:
4595 | basic_format_arg() noexcept : _M_type(__format::_Arg_none)
{ }
| ^~~~~~~~~~~~~~~~
• candidate expects 0 arguments, 1 provided
• candidate 3: 'constexpr
std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >::basic_format_arg(const
std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >&)'
/cefs/8e/8e1261270580550345114ecf_gcc-trunk-20261117/include/c++/17.0.0/format:4586:11:
4586 | class basic_format_arg
| ^~~~~~~~~~~~~~~~
• no known conversion for argument 1 from 'const
std::chrono::time_point<std::filesystem::__file_clock>' to 'const
std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >&'
• candidate 4: 'constexpr
std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char>
>::basic_format_arg(std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >&&)'
• no known conversion for argument 1 from 'const
std::chrono::time_point<std::filesystem::__file_clock>' to
'std::basic_format_arg<std::basic_format_context<std::__format::_Sink_iter<char>,
char> >&&'
Compiler returned: 1
```
Adding `#include <chrono>` resolves the error. This is surprising: there is no
mention of `std::chrono` anywhere in the code and the error message is
unhelpful in locating the real problem.