GCC Newspaper
JULY 29, 2026
Date
/
Architectures
Components
Topics
News & Policy
libstdc++

libstdc++: Fix condition for stopping lazy zone expansion

Corrects zone expansion logic in C++20 timezone database to handle DST transitions accurately.

The C++20 timezone database’s lazy zone expansion logic has been corrected. Previously, it incorrectly assumed expansion could only resume from a standard time (STD) zone. This patch modifies the condition to properly handle transitions between daylight saving time (DST) zones, ensuring more accurate time zone data handling. A test case for a specific historical transition in the America/Dawson timezone is included.

In Details

The time_zone::_M_get_sys_info function in libstdc++ handles expanding timezone data. Expansion must resume from a STD zone (save == 0). The previous check limited resumption to STD zones, but some DST rules transition between DST zones. This commit corrects the condition to check next_rule for being absent or having save == 0, allowing correct expansion across DST transitions.

For Context
libstdc++
The C++ standard library implementation used by GCC. It provides core language features like input/output, containers, and algorithms.
timezone database
A collection of historical and future timezone information, including rules for daylight saving time (DST) transitions, used by the C++ <chrono> library.
lazy expansion
A mechanism where timezone data is expanded on demand rather than all at once, optimizing for memory usage when not all historical or future data is needed.
STD zone
A timezone abbreviation indicating Standard Time, typically the offset from UTC when Daylight Saving Time is not in effect.
DST zone
A timezone abbreviation indicating Daylight Saving Time, typically representing an offset one hour ahead of Standard Time during warmer months.
Filed Under: libstdc++time zonec++20bugfix