mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-01 11:44:26 +02:00
Improve range check on year
* The previous fix broke parsing of sub-date quantities such as durations.
This commit is contained in:
@@ -6997,7 +6997,7 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
|
||||
goto broken;
|
||||
}
|
||||
if (Y < static_cast<int>(year::min()) || Y > static_cast<int>(year::max()))
|
||||
goto broken;
|
||||
Y = not_a_year;
|
||||
auto ymd = year{Y}/m/d;
|
||||
if (wd != not_a_weekday && ymd.ok())
|
||||
{
|
||||
|
Reference in New Issue
Block a user