https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101136
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- This is because the _GLIBCXX_USE_WCHAR_T macro is not defined, because <wchar.h> etc are not complete on the target, so we don't have e.g. wcslen and other wchar_t functions. However, the wchar_t type is always defined for C++ and so the template can be used with it. So not a bug, but the expected behaviour. See mails from me last year about enabling more of the library without needing <wchar.h>, which would fix this.