mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 20:01:31 -05:00
This patch addresses several issues related to the additional specializations for enable_nonlocking_formatter_optimization fomr P3235R3 proposal: * LWG4399 [1]: Apply remove_cvref_t to tuple and pair elements when checking if the direct printing optimization is enabled. * LWG4398 [2]: Disable the direct printing optimization for the standard library container adaptors: queue, priority_queue, and stack. * LWG4400 [3]: Enable the direct printing optimization only for durations that use standard arithmetic types. Conditionally enable it for hh_mm_ss and time_points based on their underlying Duration template argument. [1] https://cplusplus.github.io/LWG/issue4399 [2] https://cplusplus.github.io/LWG/issue4398 [3] https://cplusplus.github.io/LWG/issue4400 PR libstdc++/121790 libstdc++-v3/ChangeLog: * include/bits/chrono_io.h (enable_nonlocking_formatter_optimization): Adjust specializations for duration, hh_mm_ss and time_points. * include/std/format (enable_nonlocking_formatter_optimization): Apply remove_cvref_t on pair and tuple elements. * include/std/queue (enable_nonlocking_formatter_optimization): Change specialization value to false. * include/std/stack (enable_nonlocking_formatter_optimization): Change specialization value to false. * testsuite/std/format/ranges/adaptors.cc: Adjusted tests. * testsuite/std/format/tuple.cc: Adjusted tests. * testsuite/std/time/format/nonlocking.cc: Adjusted tests. Reviewed-by: Jonathan Wakely <jwakely@redhat.com>