]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Fix narrowing conversion in std/time/clock/utc/io.cc
authorJonathan Wakely <jwakely@redhat.com>
Sun, 15 Jan 2023 12:38:31 +0000 (12:38 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Sun, 15 Jan 2023 12:44:23 +0000 (12:44 +0000)
commit4dc4584b6079ac801ed5f0c79d335891821dbb3b
tree5e929f150273ee03046beea7ce63691782d5c34d
parente658e8157db372555a853c02824f5fc78709a5b1
libstdc++: Fix narrowing conversion in std/time/clock/utc/io.cc

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.
libstdc++-v3/testsuite/std/time/clock/utc/io.cc