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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by John David Anglin <[email protected]>:

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

commit r17-6848-g0cc80d1e82c399a64f24ebc2cddf162980d0d286
Author: John David Anglin <[email protected]>
Date:   Mon Nov 30 10:09:36 2026 -0500

    libstdc++: Work around gdb.error for hh_mm_ss::fractional_width [PR128817]

    When GDB fails to materialize the static constexpr member
    std::chrono::hh_mm_ss::fractional_width (reporting 'value has been
    optimized out' even at -O0), StdChronoCalendarPrinter.to_string raises
    a gdb.error.

    Catch gdb.error when evaluating val['fractional_width'] and fall back
    to computing the fractional width from the Duration template argument's
    std::ratio period per C++20 [time.hms].

    libstdc++-v3/ChangeLog:

            PR libstdc++/128817
            * python/libstdcxx/v6/printers.py
            (StdChronoCalendarPrinter.to_string): Fall back to deriving
            fractional_width from the Duration template argument if
            val['fractional_width'] raises gdb.error.

Reply via email to