From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id BD06E3857C61; Thu, 25 Feb 2021 16:57:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD06E3857C61 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-7397] libstdc++: Use uint32_t for all year_month_day::_S_from_days arithmetic X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 232f7461167d58f77f52f881f36145faf27b25d6 X-Git-Newrev: a47cec4ca7302e65f63490ad7f251c5a469bc0e0 Message-Id: <20210225165728.BD06E3857C61@sourceware.org> Date: Thu, 25 Feb 2021 16:57:28 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2021 16:57:28 -0000 https://gcc.gnu.org/g:a47cec4ca7302e65f63490ad7f251c5a469bc0e0 commit r11-7397-ga47cec4ca7302e65f63490ad7f251c5a469bc0e0 Author: Jonathan Wakely Date: Thu Feb 25 16:57:20 2021 +0000 libstdc++: Use uint32_t for all year_month_day::_S_from_days arithmetic libstdc++-v3/ChangeLog: * include/std/chrono (year_month_day::_S_from_days): Perform all calculations with type uint32_t. Diff: --- libstdc++-v3/include/std/chrono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index eef503af274..fcdaee7328e 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -2455,7 +2455,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr auto __z2 = static_cast(-1468000); constexpr auto __r2_e3 = static_cast(536895458); - const auto __r0 = __dp.count() + __r2_e3; + const auto __r0 = static_cast(__dp.count()) + __r2_e3; const auto __n1 = 4 * __r0 + 3; const auto __q1 = __n1 / 146097;