From: Joseph Faulls Date: Fri, 2 Jun 2023 15:44:48 +0000 (+0000) Subject: libstdc++: Do not assume existence of char8_t codecvt facet X-Git-Tag: basepoints/gcc-15~8567 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d9b3ddb5fc9087c17645d53e6bcb1881e1955a4;p=thirdparty%2Fgcc.git libstdc++: Do not assume existence of char8_t codecvt facet It is not required that codecvt facet be supported by the locale, nor is it added as part of the default locale. This can lead to dangerous behaviour when static_cast. libstdc++-v3/ChangeLog: * include/bits/locale_classes.tcc: Remove check for codecvt facet. --- diff --git a/libstdc++-v3/include/bits/locale_classes.tcc b/libstdc++-v3/include/bits/locale_classes.tcc index 94838cd7796e..2351dd5bcfb3 100644 --- a/libstdc++-v3/include/bits/locale_classes.tcc +++ b/libstdc++-v3/include/bits/locale_classes.tcc @@ -129,9 +129,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_STD_FACET(time_put); _GLIBCXX_STD_FACET(messages); #endif -#ifdef _GLIBCXX_USE_CHAR8_T - _GLIBCXX_STD_FACET(codecvt); -#endif #if __cplusplus >= 201103L _GLIBCXX_STD_FACET(codecvt); _GLIBCXX_STD_FACET(codecvt);