public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-7388] libstdc++: Fix narrowing conversion in year_month_day [PR 99265] Date: Thu, 25 Feb 2021 11:54:13 +0000 (GMT) [thread overview] Message-ID: <20210225115413.715323857003@sourceware.org> (raw) https://gcc.gnu.org/g:75c74a83acee3f51e6753b8159fa600fe2d86810 commit r11-7388-g75c74a83acee3f51e6753b8159fa600fe2d86810 Author: Jonathan Wakely <jwakely@redhat.com> Date: Thu Feb 25 11:48:18 2021 +0000 libstdc++: Fix narrowing conversion in year_month_day [PR 99265] libstdc++-v3/ChangeLog: PR libstdc++/99265 * include/std/chrono (year_month_day::_S_from_days): Cast long to int explicitly. Diff: --- libstdc++-v3/include/std/chrono | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index feb2c2a1fad..eef503af274 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -2481,8 +2481,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION const auto __m1 = __j ? __m0 - 12 : __m0; const auto __d1 = __d0 + 1; - return year_month_day{chrono::year{__y1 + __z2}, chrono::month{__m1}, - chrono::day{__d1}}; + return year_month_day{chrono::year{static_cast<int>(__y1 + __z2)}, + chrono::month{__m1}, chrono::day{__d1}}; } // Days since 1970/01/01.
reply other threads:[~2021-02-25 11:54 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210225115413.715323857003@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).