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

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

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

commit r16-2190-g4faa42ac0dee2c26ed68f0df002837e7e1c95687
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Fri May 16 13:33:23 2025 +0100

    libstdc++: Treat __int128 as a real integral type [PR96710]

    Since LWG 3828 (included in C++23) implementations are allowed to have
    extended integer types that are wider than intmax_t. This means we no
    longer have to make is_integral_v<__int128> false for strict -std=c++23
    mode, removing the confusing inconsistency with -std=gnu++23 (where
    is_integral_v<__int128> is true).

    This change makes __int128 a true integral type for all modes, treating
    LWG 3828 as a DR for previous standards. Most of the change just
    involves removing special cases where we wanted to treat __int128 and
    unsigned __int128 as integral types even when is_integral_v was false.

    There are still some preprocessor conditionals needed, because on some
    targets the compiler defines the macro __GLIBCXX_TYPE_INT_N_0 as
    __int128 in non-strict modes. Because we define explicit specializations
    of templates such as is_integral for all the INT_N types, we already
    have a specialization of is_integral<__int128> in non-strict modes, and
    so to avoid a redefinition we only must only define
    is_integral<__int128> for strict modes.

    libstdc++-v3/ChangeLog:

            PR libstdc++/96710
            * include/bits/cpp_type_traits.h (__is_integer): Define explicit
            specializations for __int128.
            (__memcpyable_integer): Remove explicit specializations for
            __int128.
            * include/bits/iterator_concepts.h (incrementable_traits):
            Likewise.
            (__is_signed_int128, __is_unsigned_int128, __is_int128): Remove.
            (__is_integer_like, __is_signed_integer_like): Remove check for
            __int128.
            * include/bits/max_size_type.h: Remove all uses of __is_int128
            in constraints.
            * include/bits/ranges_base.h (__to_unsigned_like): Remove
            overloads for __int128.
            (ranges::ssize): Remove special case for __int128.
            * include/bits/stl_algobase.h (__size_to_integer): Define
            __int128 overloads for strict modes.
            * include/ext/numeric_traits.h (__is_integer_nonstrict): Remove
            explicit specializations for __int128.
            * include/std/charconv (to_chars): Define overloads for
            __int128.
            * include/std/format (__format::make_unsigned_t): Remove.
            (__format::to_chars): Remove.
            * include/std/limits (numeric_limits): Define explicit
            specializations for __int128.
            * include/std/type_traits (__is_integral_helper): Likewise.
            (__make_unsigned, __make_signed): Likewise.

    Reviewed-by: Patrick Palka <ppa...@redhat.com>
  • [Bug libstdc++/96710] __int128 ... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to