https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125118

            Bug ID: 125118
           Summary: Missing freestanding header: cwchar
           Product: gcc
           Version: 16.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
                CC: daniel.kruegler at googlemail dot com,
                    felix.morgner at gmail dot com
  Target Milestone: ---

+++ This bug was initially created as a clone of Bug #125112 +++

When GCC is configured with --disable-hosted-libstdcxx --enable-wchar_t it
installs the <ranges> header, but including it fails because <cwchar> isn't in
the set of freestanding headers:

In file included from /home/test/gcc/free/include/c++/16.1.1/string_view:51,
                 from /home/test/gcc/free/include/c++/16.1.1/ranges:48,
                 from r.cc:1:
/home/test/gcc/free/include/c++/16.1.1/bits/char_traits.h:48:11: fatal error:
cwchar: No such file or directory
   48 | # include <cwchar>              // For WEOF, wmemmove, wmemset, etc.
      |           ^~~~~~~~

One solution would be to default to --disable-wchar_t for non-hosted builds,
but we should probably just add cwchar to the freestanding headers so that
std::wstring_view works.

Reply via email to