libstdc++: Support wide characters output for sys_info and local_info [PR120565]
Formatting sys_info as wchar_t require widening of the abbrev (zone) member.
To support that we reuse the existing code in support for '%Z' specifier, for
local_time_format, and produce output using singe format call with
"[{0:%F %T},{1:%F %T},{2:%T},{3:%Q%q},{0:%Z}]" format string. As noted in the
comment, produced output is locale independed, as it does not contain decimal
separtors.
For sys_info, the outputed literals are widended using _GLIBCXX_WIDEN, except
opening and closing brackets, that are fetched from __format::_Separators.
PR libstdc++/120565
libstdc++-v3/ChangeLog:
* include/bits/chrono_io.h
(operator<<(basic_ostream<_CharT, _Traits>&, const sys_info&))
(operator<<(basic_ostream<_CharT, _Traits>&, const local_info&)):
Support wchar_t as _CharT.
* testsuite/std/time/format/empty_spec.cc: Instantiated test_infos for
wchar_t and increase timeout.
Reviewed-by: Jonathan Wakely <jwakely@redhat.com> Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>