public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t
@ 2021-01-18 11:08 redi at gcc dot gnu.org
  2021-01-18 14:23 ` [Bug libstdc++/98725] " cvs-commit at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2021-01-18 11:08 UTC (permalink / raw)
  To: gcc-bugs

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

            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 (which
doesn't use wchar_t at all). That's because we do this in <bits/locale_conv.h>:

 #ifdef _GLIBCXX_USE_WCHAR_T

 _GLIBCXX_BEGIN_NAMESPACE_CXX11

   /// String conversions
   template<typename _Codecvt, typename _Elem = wchar_t,
           typename _Wide_alloc = allocator<_Elem>,
           typename _Byte_alloc = allocator<char>>
     class wstring_convert


The wchar_t type exists unconditionally for C++, so traits like
std::is_integral_v<wchar_t> are already always defined as true.
std::char_traits<wchar_t> 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 <wchar.h> 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.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
@ 2021-01-18 14:23 ` cvs-commit at gcc dot gnu.org
  2021-01-18 14:24 ` redi at gcc dot gnu.org
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-18 14:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:ec153f96f8943f1d2418d2248ed219358990bb5f

commit r11-6771-gec153f96f8943f1d2418d2248ed219358990bb5f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Jan 18 14:23:13 2021 +0000

    libstdc++: Only test writing to wostream if supported [PR 98725]

    libstdc++-v3/ChangeLog:

            PR libstdc++/98725
            * testsuite/20_util/unique_ptr/io/lwg2948.cc:  Do not try to
            write to a wide character stream if wide character support is
            disabled in the library.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
  2021-01-18 14:23 ` [Bug libstdc++/98725] " cvs-commit at gcc dot gnu.org
@ 2021-01-18 14:24 ` redi at gcc dot gnu.org
  2021-04-19 10:40 ` redi at gcc dot gnu.org
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2021-01-18 14:24 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-01-18
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
   Target Milestone|---                         |12.0
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
  2021-01-18 14:23 ` [Bug libstdc++/98725] " cvs-commit at gcc dot gnu.org
  2021-01-18 14:24 ` redi at gcc dot gnu.org
@ 2021-04-19 10:40 ` redi at gcc dot gnu.org
  2021-10-08 12:03 ` redi at gcc dot gnu.org
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-19 10:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|redi at gcc dot gnu.org            |unassigned at gcc dot gnu.org
             Status|ASSIGNED                    |NEW

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-04-19 10:40 ` redi at gcc dot gnu.org
@ 2021-10-08 12:03 ` redi at gcc dot gnu.org
  2021-10-08 14:08 ` redi at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2021-10-08 12:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |101136

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
There's a patch at
https://gcc.gnu.org/pipermail/libstdc++/2021-January/051868.html relevant to
this.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101136
[Bug 101136] msdosdjgpp toolchain cannot find std::wstring_view

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-10-08 12:03 ` redi at gcc dot gnu.org
@ 2021-10-08 14:08 ` redi at gcc dot gnu.org
  2021-10-08 14:48 ` redi at gcc dot gnu.org
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2021-10-08 14:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Locales, fstream, std::wregex, and filesystem::path need wchar_t support in
libc, so they should still depend on _GLIBCXX_USE_WCHAR_T.

Numeric conversions (std::stoi, std::stol etc.) need libc support.

It makes sense to suppress the explicit instantiations of std::wstring etc in
the library if --disable-wchar_t is used.

wstringstream and friends could probably be made to work. I'm not going to try
for now.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-10-08 14:08 ` redi at gcc dot gnu.org
@ 2021-10-08 14:48 ` redi at gcc dot gnu.org
  2021-10-08 14:51 ` cvs-commit at gcc dot gnu.org
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2021-10-08 14:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The definitions of the static constants in numeric_limits<wchar_t> are define
conditionally in src/c++11/limits.cc

That seems wrong, because the specialization numeric_limits<wchar_t> is defined
unconditionally in the <limits> header. That means some uses of those constants
will result in linker errors for a --disable-wchar_t build.

However, defining them unconditionally would alter the ABI (and slightly
increase the size of libstdc++.so) for --disable-wchar_t builds, so is less
obviously the right choice than some other cases.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-10-08 14:48 ` redi at gcc dot gnu.org
@ 2021-10-08 14:51 ` cvs-commit at gcc dot gnu.org
  2021-10-08 19:12 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-08 14:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:e6f6972b5f4711c110fa753c926df49415f230da

commit r12-4255-ge6f6972b5f4711c110fa753c926df49415f230da
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 8 14:45:23 2021 +0100

    libstdc++: Detect miscompilation of src/c++11/limits.cc

    Add a #error directive to ensure that the definitions are not compiled
    as C++17, which would prevent them being emitted.

    libstdc++-v3/ChangeLog:

            PR libstdc++/98725
            * src/c++11/limits.cc: Fail if __cpp_inline_variables is
            defined.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-10-08 14:51 ` cvs-commit at gcc dot gnu.org
@ 2021-10-08 19:12 ` redi at gcc dot gnu.org
  2021-10-08 23:31 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2021-10-08 19:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
<cwchar> could do this after including <wchar.h>:

#if !defined WCHAR_MIN && defined __WCHAR_MIN__
# define WCHAR_MIN __WCHAR_MIN__
#endif

#if !defined WCHAR_MAX && defined __WCHAR_MAX__
# define WCHAR_MAX __WCHAR_MAX__
#endif

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2021-10-08 19:12 ` redi at gcc dot gnu.org
@ 2021-10-08 23:31 ` redi at gcc dot gnu.org
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2021-10-08 23:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We could make codecvt<wchar_t, char, mbstate_t> work if we assume that wchar_t
contains UTF-32 or UTF-16 (depending on the size of wchar_t) and reuse the
specializations for char32_t and char16_t. Those specializations are
implemented entirely in libstdc++ with no libc help.

It's unclear (to me) whether --disable-wchar_t is used explicitly to produce a
smaller libstdc++ build, without wchar_t instantiations, or is just used
implicitly on systems where the libc <wchar.h> support is missing. So it's hard
to know whether "emulate wchar_t support in terms of UTF-32" is desirable, or
if that would frustrate users explicitly trying to get a smaller library.

Presumably anybody who wants a smaller library would also want to disable the
codecvt facets for char32_t and char16_t, but nobody has requested that.

I'm not going to spend any more time on it after enabling wide strings and some
type traits.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-10-08 23:31 ` redi at gcc dot gnu.org
@ 2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-09  0:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:0afb9ebaab09b999f1d158ffc3fb906fdab9df67

commit r12-4263-g0afb9ebaab09b999f1d158ffc3fb906fdab9df67
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 8 14:24:18 2021 +0100

    libstdc++: Always define typedefs and hash functions for wide strings [PR
98725]

    The wstring and wstring_view typedefs should be enabled even if
    <wchar.h> isn't supported, because char_traits<wchar_t> works
    unconditionally. Similarly, the std::hash specializations for wide
    strings do not depend on <wchar.h> support.

    Although the primary template works OK for std::char_traits<wchar_t> in
    the absence of <wchar.h> support, this patch still defines it as an
    explicit specialization for compatibility with declarations that expect
    it to be specialized. The explicit specialization just uses the same
    __gnu_cxx::char_traits base class as the primary template.

    libstdc++-v3/ChangeLog:

            PR libstdc++/98725
            * include/bits/char_traits.h (char_traits<wchar_t>): Define
            explicit specialization unconditionally.
            * include/bits/basic_string.h (hash<wstring>): Define
            unconditionally. Do not check _GLIBCXX_USE_WCHAR_T.
            * include/bits/stringfwd.h (wstring): Likewise.
            * include/debug/string (wstring): Likewise.
            * include/experimental/string_view (experimental::wstring_view)
            (hash<experimental::wstring_view>): Likewise.
            * include/std/string (pmr::wstring, hash<pmr::wstring>):
            Likewise.
            * include/std/string_view (wstring_view, hash<wstring_view>):
            Likewise.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
@ 2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-09  0:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:4997c8b30ecfc82f9e6ce874cbd3840e227522eb

commit r12-4264-g4997c8b30ecfc82f9e6ce874cbd3840e227522eb
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 8 14:48:04 2021 +0100

    libstdc++: Enable vstring for wchar_t unconditionally [PR98725]

    None of these vstring specializations depend on libc support for
    wchar_t, so can be enabled unconditionally now that char_traits<wchar_t>
    is always available.

    libstdc++-v3/ChangeLog:

            PR libstdc++/98725
            * include/ext/rc_string_base.h [!_GLIBCXX_USE_WCHAR_T]
            (__rc_string_base<wchar_t>): Define member function.
            * include/ext/vstring.h [!_GLIBCXX_USE_WCHAR_T]
            (hash<__gnu_cxx::__wvstring>): Define specialization.
            * include/ext/vstring_fwd.h [!_GLIBCXX_USE_WCHAR_T] (__wvstring)
            (__wsso_string, __wrc_string): Declare typedefs.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
@ 2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-09  0:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:4bdb9d618d30fc33d7eaab374baf377fa4e9d955

commit r12-4265-g4bdb9d618d30fc33d7eaab374baf377fa4e9d955
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 8 14:52:07 2021 +0100

    libstdc++: Enable type traits for wchar_t unconditionally [PR98725]

    None of these traits depend on libc support for wchar_t, so they should
    be defined unconditionally. The wchar_t type is always defined in C++.

    libstdc++-v3/ChangeLog:

            PR libstdc++/98725
            * include/c_global/cstddef [!_GLIBCXX_USE_WCHAR_T]
            (__byte_operand<wchar_t>): Define specialization.
            * include/std/type_traits (__make_signed<wchar_t>)
            (__make_unsigned<wchar_t>): Remove redundant check for
            __WCHAR_TYPE__ being defined.
            * include/tr1/type_traits [!_GLIBCXX_USE_WCHAR_T]
            (__is_integral_helper<wchar_t>): Likewise.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
@ 2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-09  0:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:3c9fbc26af6739c7ddf8f0895ae68b530cf88bbe

commit r12-4266-g3c9fbc26af6739c7ddf8f0895ae68b530cf88bbe
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 8 14:25:42 2021 +0100

    libstdc++: Define std::wstring_convert unconditionally [PR 98725]

    The wchar_t type is defined unconditionally for C++, so there is no
    reason for std::wstring_convert and std::wbuffer_convert to be disabled
    when <wchar.h> is not usable. It should be possible to use those class
    templates with char16_t and char32_t even if wchar_t conversions don't
    work.

    libstdc++-v3/ChangeLog:

            PR libstdc++/98725
            * include/bits/locale_conv.h (wstring_convert, wbuffer_convert):
            Define unconditionally. Do not check _GLIBCXX_USE_WCHAR_T.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
@ 2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-09  0:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:9a89281c4005a51eeed058ca66bcce8df1dd1b24

commit r12-4267-g9a89281c4005a51eeed058ca66bcce8df1dd1b24
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 8 14:26:09 2021 +0100

    libstdc++: Define deleted wchar_t overloads unconditionally [PR 98725]

    We don't need to have <wchar.h> support in order to delete overloads
    for inserting wide characters into narrow streams.

    libstdc++-v3/ChangeLog:

            PR libstdc++/98725
            * include/std/ostream (operator<<(basic_ostream<char, Tr>&,
wchar_t))
            (operator<<(basic_ostream<char, Tr>&, const wchar_t*)): Always
            define as deleted. Do not check _GLIBCXX_USE_WCHAR_T.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
@ 2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
  2021-10-09  0:16 ` redi at gcc dot gnu.org
  2021-11-24 11:51 ` cvs-commit at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-09  0:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:fec283b63d7f24f4c37792dd07ab1055186ba88f

commit r12-4268-gfec283b63d7f24f4c37792dd07ab1055186ba88f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 8 20:48:35 2021 +0100

    libstdc++: Remove unnecessary uses of _GLIBCXX_USE_WCHAR_T in testsuite
[PR98725]

    Now that std::wstring and other specializations for wchar_t are defined
    unconditionally, many checks for _GLIBCXX_USE_WCHAR_T in the testsuite
    are unnecessary and can be removed. Tests for iostreams, locales, regex
    and filesystem::path still need to be guarded by _GLIBCXX_USE_WCHAR_T
    because those components depend on libc support in <wchar.h> and other
    headers.

    libstdc++-v3/ChangeLog:

            PR libstdc++/98725
            * testsuite/18_support/numeric_limits/lowest.cc: Remove use of
            _GLIBCXX_USE_WCHAR_T.
            * testsuite/18_support/numeric_limits/min_max.cc: Replace use of
            _GLIBCXX_USE_WCHAR_T with checks for WCHAR_MIN and WCHAR_MAX.
            * testsuite/20_util/from_chars/1_neg.cc: Remove use of
            _GLIBCXX_USE_WCHAR_T.
            * testsuite/20_util/function_objects/searchers.cc: Likewise. Use
            char_traits<wchar_t>::length instead of wcslen.
            * testsuite/20_util/hash/requirements/explicit_instantiation.cc:
            Likewise.
            * testsuite/20_util/is_arithmetic/value.cc: Likewise.
            * testsuite/20_util/is_compound/value.cc: Likewise.
            * testsuite/20_util/is_floating_point/value.cc: Likewise.
            * testsuite/20_util/is_fundamental/value.cc: Likewise.
            * testsuite/20_util/is_integral/value.cc: Likewise.
            * testsuite/20_util/is_signed/value.cc: Likewise.
            * testsuite/20_util/is_unsigned/value.cc: Likewise.
            * testsuite/20_util/is_void/value.cc: Likewise.
            * testsuite/20_util/make_signed/requirements/typedefs-1.cc:
            Likewise.
            * testsuite/20_util/make_signed/requirements/typedefs-2.cc:
            Likewise.
            * testsuite/20_util/make_signed/requirements/typedefs-3.cc:
            Likewise.
            * testsuite/20_util/make_signed/requirements/typedefs-4.cc:
            Likewise.
            * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc:
            Likewise.
            * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc:
            Likewise.
            * testsuite/20_util/make_unsigned/requirements/typedefs-3.cc:
            Likewise.
            * testsuite/20_util/to_chars/3.cc: Likewise.
            * testsuite/20_util/type_identity/requirements/typedefs.cc:
            Likewise.
            * testsuite/21_strings/basic_string/hash/debug.cc: Likewise.
            * testsuite/21_strings/basic_string/hash/hash.cc: Likewise.
            * testsuite/21_strings/basic_string/literals/types-char8_t.cc:
            Likewise.
            * testsuite/21_strings/basic_string/literals/types.cc: Likewise.
            * testsuite/21_strings/basic_string/literals/values-char8_t.cc:
            Likewise.
            * testsuite/21_strings/basic_string/literals/values.cc:
            Likewise.
            * testsuite/21_strings/basic_string/modifiers/64422.cc:
            Likewise.
            * testsuite/21_strings/basic_string/range_access/wchar_t/1.cc:
            Likewise.
            * testsuite/21_strings/basic_string/requirements/citerators.cc:
            Likewise.
            * testsuite/21_strings/basic_string/requirements/typedefs.cc:
            Likewise.
            * testsuite/21_strings/basic_string/types/pmr_typedefs.cc:
            Likewise.
            * testsuite/21_strings/basic_string_view/literals/types-char8_t.cc:
            Likewise.
            * testsuite/21_strings/basic_string_view/literals/types.cc:
            Likewise.
            *
testsuite/21_strings/basic_string_view/literals/values-char8_t.cc:
            Likewise.
            * testsuite/21_strings/basic_string_view/literals/values.cc:
            Likewise.
            * testsuite/21_strings/basic_string_view/requirements/typedefs.cc:
            Likewise.
            * testsuite/21_strings/basic_string_view/typedefs.cc: Likewise.
            *
testsuite/21_strings/char_traits/requirements/constexpr_functions.cc:
            Likewise.
            *
testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc:
            Likewise.
            *
testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
            Likewise.
            * testsuite/22_locale/ctype/is/string/89728_neg.cc: Likewise.
            * testsuite/25_algorithms/fill/4.cc: Likewise.
            * testsuite/25_algorithms/fill_n/1.cc: Likewise.
            * testsuite/experimental/functional/searchers.cc: Likewise. Use
            char_traits<wchar_t>::length instead of wcslen.
            *
testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
            Likewise.
            * testsuite/experimental/string_view/literals/types-char8_t.cc:
            Likewise.
            * testsuite/experimental/string_view/literals/types.cc:
            Likewise.
            * testsuite/experimental/string_view/literals/values-char8_t.cc:
            Likewise.
            * testsuite/experimental/string_view/literals/values.cc:
            Likewise.
            * testsuite/experimental/string_view/range_access/wchar_t/1.cc:
            Likewise.
            * testsuite/experimental/string_view/requirements/typedefs.cc:
            Likewise.
            * testsuite/experimental/string_view/typedefs.cc: Likewise.
            * testsuite/ext/vstring/range_access.cc: Likewise.
            *
testsuite/std/concepts/concepts.lang/concept.arithmetic/integral.cc:
            Likewise.
            *
testsuite/std/concepts/concepts.lang/concept.arithmetic/signed_integral.cc:
            Likewise.
            *
testsuite/std/concepts/concepts.lang/concept.arithmetic/unsigned_integral.cc:
            Likewise.
            * testsuite/tr1/4_metaprogramming/is_arithmetic/value.cc:
            Likewise.
            * testsuite/tr1/4_metaprogramming/is_compound/value.cc:
            Likewise.
            * testsuite/tr1/4_metaprogramming/is_floating_point/value.cc:
            Likewise.
            * testsuite/tr1/4_metaprogramming/is_fundamental/value.cc:
            Likewise.
            * testsuite/tr1/4_metaprogramming/is_integral/value.cc:
            Likewise.
            * testsuite/tr1/4_metaprogramming/is_signed/value.cc: Likewise.
            * testsuite/tr1/4_metaprogramming/is_unsigned/value.cc:
            Likewise.
            * testsuite/tr1/4_metaprogramming/is_void/value.cc: Likewise.
            * testsuite/tr1/6_containers/hash/24799.cc: Likewise.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
@ 2021-10-09  0:16 ` redi at gcc dot gnu.org
  2021-11-24 11:51 ` cvs-commit at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: redi at gcc dot gnu.org @ 2021-10-09  0:16 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed, as much as I plan to fix it anyway.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Bug libstdc++/98725] Review what is disabled in libstdc++ by --disable-wchar_t
  2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2021-10-09  0:16 ` redi at gcc dot gnu.org
@ 2021-11-24 11:51 ` cvs-commit at gcc dot gnu.org
  16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-24 11:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:ecc43c92151141e3e862a344f753516dc6d5d967

commit r11-9295-gecc43c92151141e3e862a344f753516dc6d5d967
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 8 14:26:09 2021 +0100

    libstdc++: Define deleted wchar_t overloads unconditionally [PR 98725]

    We don't need to have <wchar.h> support in order to delete overloads
    for inserting wide characters into narrow streams.

    libstdc++-v3/ChangeLog:

            PR libstdc++/98725
            * include/std/ostream (operator<<(basic_ostream<char, Tr>&,
wchar_t))
            (operator<<(basic_ostream<char, Tr>&, const wchar_t*)): Always
            define as deleted. Do not check _GLIBCXX_USE_WCHAR_T.

    (cherry picked from commit 9a89281c4005a51eeed058ca66bcce8df1dd1b24)

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-11-24 11:51 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 11:08 [Bug libstdc++/98725] New: Review what is disabled in libstdc++ by --disable-wchar_t redi at gcc dot gnu.org
2021-01-18 14:23 ` [Bug libstdc++/98725] " cvs-commit at gcc dot gnu.org
2021-01-18 14:24 ` redi at gcc dot gnu.org
2021-04-19 10:40 ` redi at gcc dot gnu.org
2021-10-08 12:03 ` redi at gcc dot gnu.org
2021-10-08 14:08 ` redi at gcc dot gnu.org
2021-10-08 14:48 ` redi at gcc dot gnu.org
2021-10-08 14:51 ` cvs-commit at gcc dot gnu.org
2021-10-08 19:12 ` redi at gcc dot gnu.org
2021-10-08 23:31 ` redi at gcc dot gnu.org
2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
2021-10-09  0:15 ` cvs-commit at gcc dot gnu.org
2021-10-09  0:16 ` redi at gcc dot gnu.org
2021-11-24 11:51 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).