public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-7397] libstdc++: Use uint32_t for all year_month_day::_S_from_days arithmetic
@ 2021-02-25 16:57 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-02-25 16:57 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:a47cec4ca7302e65f63490ad7f251c5a469bc0e0

commit r11-7397-ga47cec4ca7302e65f63490ad7f251c5a469bc0e0
Author: Jonathan Wakely <jwakely@redhat.com>
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<uint32_t>(-1468000);
       constexpr auto __r2_e3 = static_cast<uint32_t>(536895458);
 
-      const auto __r0 = __dp.count() + __r2_e3;
+      const auto __r0 = static_cast<uint32_t>(__dp.count()) + __r2_e3;
 
       const auto __n1 = 4 * __r0 + 3;
       const auto __q1 = __n1 / 146097;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-25 16:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25 16:57 [gcc r11-7397] libstdc++: Use uint32_t for all year_month_day::_S_from_days arithmetic Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).