From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6B9BA38460B4; Mon, 18 Jan 2021 11:08:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B9BA38460B4 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t Date: Mon, 18 Jan 2021 11:08:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2021 11:08:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98725 Bug ID: 98725 Summary: Review what is disabled in libstdc++ by --disable-wchar_t Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- Currently libstdc++ guards *any* use of wchar_t with a check for _GLIBCXX_USE_WCHAR_T. This has unfortunate consequences such as std::wstring_convert being unusable to convert between char and char16_t (w= hich doesn't use wchar_t at all). That's because we do this in : #ifdef _GLIBCXX_USE_WCHAR_T _GLIBCXX_BEGIN_NAMESPACE_CXX11 /// String conversions template, typename _Byte_alloc =3D allocator> class wstring_convert The wchar_t type exists unconditionally for C++, so traits like std::is_integral_v are already always defined as true. std::char_traits also works, by using the primary template (which works for any character-like type). That means that even std::wstring works, albeit slower than if we had optimized support for in libc. The consequences of --disable-wchar_t (whether implicit or explicit) should= to disable explicit instantiations for std::wstring, std::wifstream etc. and to disable wchar_t support in locales and std::filesystem. It doesn't need to disable everything that refers to wchar_t.=