GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libstdc++

libstdc++: Rename _M_is_leap_second to _M_60th_second in chrono::parse

Renames a flag in `chrono::parse` to more accurately reflect its meaning of parsing a 60th second, not necessarily a leap second.

The _M_is_leap_second flag within chrono::parse has been renamed to _M_60th_second. This change improves clarity as the flag previously indicated that ‘60’ or a fractional value was parsed for the seconds field, which does not definitively confirm a leap second. The new name accurately describes the flag’s function without implying a leap second occurrence.

In Details

The _Parser class in libstdc++'s <chrono_io.h> handles parsing time strings. The flag _M_is_leap_second was used to track if the seconds field parsed was '60'. However, this doesn't guarantee it's a leap second, as other conditions need to be met. This commit renames the flag to _M_60th_second to precisely reflect that it only indicates the parsing of a 60th second value, leaving the interpretation of it being a true leap second to the caller.

For Context
chrono::parse
A function within the C++ standard library's chrono facilities used for parsing time-related strings into time objects.
leap second
A one-second adjustment added occasionally to Coordinated Universal Time (UTC) to keep it close to astronomical time. Leap seconds are typically inserted at the end of June or December.
libstdc++
The GNU implementation of the C++ Standard Library.
Filed Under: libstdc++chronoclarity