public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107466] [12/13 Regression] invalid -Wnarrowing error with std::subtract_with_carry_engine Date: Mon, 28 Nov 2022 15:19:15 +0000 [thread overview] Message-ID: <bug-107466-4-dtoYWCpXHS@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107466-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107466 --- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:a64775a0edd46980036b757041f0c065ed9f8d22 commit r13-4364-ga64775a0edd46980036b757041f0c065ed9f8d22 Author: Jonathan Wakely <jwakely@redhat.com> Date: Mon Nov 28 09:44:52 2022 +0000 libstdc++: Make 16-bit std::subtract_with_carry_engine work [PR107466] This implements the proposed resolution of LWG 3809, so that std::subtract_with_carry_engine can be used with a 16-bit result_type. Currently this produces a narrowing error when instantiating the std::linear_congruential_engine to create the initial state. It also truncates the default_seed constant when passing it as a result_type argument. Change the type of the constant to uint_least32_t and pass 0u when the default_seed should be used. libstdc++-v3/ChangeLog: PR libstdc++/107466 * include/bits/random.h (subtract_with_carry_engine): Use 32-bit type for default seed. Use 0u as default argument for subtract_with_carry_engine(result_type) constructor and seed(result_type) member function. * include/bits/random.tcc (subtract_with_carry_engine): Use 32-bit type for default seed and engine used for initial state. * testsuite/26_numerics/random/subtract_with_carry_engine/cons/lwg3809.cc: New test.
next prev parent reply other threads:[~2022-11-28 15:19 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-30 18:42 [Bug c++/107466] New: [12 Regression] invalid -Wnarrowing error littlefox+gcc-bugzilla@lf-net.org 2022-10-30 18:50 ` [Bug c++/107466] [12/13 Regression] invalid -Wnarrowing error with std::subtract_with_carry_engine pinskia at gcc dot gnu.org 2022-10-30 20:40 ` redi at gcc dot gnu.org 2022-10-31 17:40 ` littlefox+gcc-bugzilla@lf-net.org 2022-11-04 20:39 ` [Bug libstdc++/107466] " redi at gcc dot gnu.org 2022-11-05 10:26 ` rguenth at gcc dot gnu.org 2022-11-25 9:38 ` redi at gcc dot gnu.org 2022-11-28 15:19 ` cvs-commit at gcc dot gnu.org [this message] 2023-04-27 11:42 ` [Bug libstdc++/107466] [12 " rguenth at gcc dot gnu.org 2023-04-27 11:42 ` rguenth at gcc dot gnu.org 2023-04-27 14:43 ` cvs-commit at gcc dot gnu.org 2023-04-27 14:44 ` redi at gcc dot gnu.org 2024-01-11 13:34 ` redi at gcc dot gnu.org 2024-01-13 0:14 ` cvs-commit at gcc dot gnu.org 2024-02-08 15:51 ` cvs-commit at gcc dot gnu.org 2024-02-08 21:28 ` cvs-commit at gcc dot gnu.org 2024-02-08 21:42 ` redi at gcc dot gnu.org
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=bug-107466-4-dtoYWCpXHS@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).