On Fri, 2 Jun 2023 at 16:45, Joseph Faulls wrote: > It is not required that codecvt<char8_t, char, mbstate_t> 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. >
Ouch, yes indeed. I don't know why I added that there. Thanks for the patch, I'll apply it to trunk and gcc-13 ASAP. > > libstdc++-v3/ChangeLog: > > > > * include/bits/locale_classes.tcc: Remove check. > > --- > > libstdc++-v3/include/bits/locale_classes.tcc | 3 --- > > 1 file changed, 3 deletions(-) > > > > diff --git a/libstdc++-v3/include/bits/locale_classes.tcc > b/libstdc++-v3/include/bits/locale_classes.tcc > > index 94838cd7796..2351dd5bcfb 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<wchar_t>); > > _GLIBCXX_STD_FACET(messages<wchar_t>); > > #endif > > -#ifdef _GLIBCXX_USE_CHAR8_T > > - _GLIBCXX_STD_FACET(codecvt<char8_t, char, mbstate_t>); > > -#endif > > #if __cplusplus >= 201103L > > _GLIBCXX_STD_FACET(codecvt<char16_t, char, mbstate_t>); > > _GLIBCXX_STD_FACET(codecvt<char32_t, char, mbstate_t>); > > -- > > 2.34.1 >