From 443a29df531a5e093409e3974f84362a12b03cac Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 30 Nov 2017 12:06:51 -0500 Subject: [PATCH] Improve range check on year * The previous fix broke parsing of sub-date quantities such as durations. --- include/date/date.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/date/date.h b/include/date/date.h index 5af9dd2..5974fc4 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -6997,7 +6997,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, goto broken; } if (Y < static_cast(year::min()) || Y > static_cast(year::max())) - goto broken; + Y = not_a_year; auto ymd = year{Y}/m/d; if (wd != not_a_weekday && ymd.ok()) {