For a port with signed char and unsigned wchar_t initializing a wchar_t
array with a char is a narrowing conversion. The code is wrong for
assuming that (int)'a' == (int)L'a' anyway, so fix it properly by using
ctype<wchar_t>::widen(char).
libstdc++-v3/ChangeLog:
* testsuite/std/time/clock/utc/io.cc: Use ctype to widen char.
std::ostringstream ss;
std::wostringstream wss;
+ const auto& ct = std::use_facet<std::ctype<wchar_t>>(wss.getloc());
for (char c : specs)
{
"required by the chrono-specs") != s.npos);
}
- wchar_t wfmt[] = { L'{', L':', L'%', c, L'}' };
+ wchar_t wfmt[] = { L'{', L':', L'%', ct.widen(c), L'}' };
try
{
wss << std::vformat(std::wstring_view(wfmt, 5),