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

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

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

commit r16-1735-g3cc45681c66e7385299cb8bdb0aa5b5123a9524e
Author: Tomasz KamiÅski <tkami...@redhat.com>
Date:   Fri Jun 27 12:35:53 2025 +0200

    libstdc++: Fix warnings introduced by type-erasing for chrono commits
[PR110739]

    The r16-1709-g4b3cefed1a08344495fedec4982d85168bd8173f caused `-Woverflow`
    in empty_spec.cc file. This warning is not cause by any issue in shipping
    code, and results in taking to much shortcut when implementing a test-only
    custom representation type Rep, where long was always used to store a
value.
    In particular common type for Rep and long long int, was de-facto long.
    This is addressed by adding Under template parameter, that controls the
type
    of stored value, and handling it properly in common_type specializations.
    No changes to shipping code are necessary.

    Secondly, extracting _M_locale_fmt calls in r16-1712-gcaac94, resulted in
__ctx
    format parameter no longer being used. This patch removes such parameter
    entirely, and replace _FormatContext template parameter, with _OutIter
parameter
    for __out. For consistency type of the __out is decoupled from
_FormatContext,
    for functions that still need context:
     * to extract locale (_M_A_a, _M_B_b, _M_c, _M_p, _M_r, _M_subsecs)
     * perform formatting for duration/subseconds (_M_Q, _M_T, _M_S,
_M_subsecs)

            PR libstdc++/110739

    libstdc++-v3/ChangeLog:

            * include/bits/chrono_io.h (__formatter_chrono::_M_format_to):
            Rename _Out to _OutIter for consistency, and update calls
            to specifier functions.
            (__formatter_chrono::_M_wi, __formatter_chrono::_M_C_y_Y)
            (__formatter_chrono::_M_D_x, __formatter_chrono::_M_d_e)
            (__formatter_chrono::_M_F, __formatter_chrono::_M_g_G)
            (__formatter_chrono::_M_H_I, __formatter_chrono::_M_j)
            (__formatter_chrono::_M_m, __formatter_chrono::_M_M)
            (__formatter_chrono::_M_q, __formatter_chrono::_M_R_X)
            (__formatter_chrono::_M_u_w, __formatter_chrono::_M_U_V_W)
            (__formatter_chrono::_M_z, __formatter_chrono::_M_z):
            Remove _FormatContext parameter, and  introduce _OutIter
            for __out type.
            (__formatter_chrono::_M_a_A, __formatter_chrono::_M_B_b)
            (__formatter_chrono::_M_p, __formatter_chrono::_M_Q)
            (__formatter_chrono::_M_r, __formatter_chrono::_M_S)
            (__formatter_chrono::_M_subsecs, __formatter_chrono::_M_T):
            Introduce separate _OutIter template parameter for __out.
            (__formatter_chrono::_M_c, __formatter_chrono::_M_T):
            Likewise, and adjust calls to specifiers functions.
            * testsuite/std/time/format/empty_spec.cc: Make underlying
            type for Rep configurable.

Reply via email to