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++/105081] Make std::random_device throw std::system_error
Date: Thu, 27 Apr 2023 10:29:54 +0000	[thread overview]
Message-ID: <bug-105081-4-6E5eW0fcgb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105081-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105081

--- Comment #3 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:f9412cedd6c0e7417b30d9a80d3f45c8746223b4

commit r14-289-gf9412cedd6c0e7417b30d9a80d3f45c8746223b4
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Apr 26 15:23:57 2023 +0100

    libstdc++: Make std::random_device throw std::system_error [PR105081]

    This changes std::random_device constructors to throw std::system_error
    (with EINVAL as the error code) when the constructor argument is
    invalid. We can also throw std::system_error when read(2) fails so that
    the exception includes the additional information provided by errno.

    As noted in the PR, this is consistent with libc++, and doesn't break
    any existing code which catches std::runtime_error, because those
    handlers will still catch std::system_error.

    libstdc++-v3/ChangeLog:

            PR libstdc++/105081
            * src/c++11/random.cc (__throw_syserr): New function.
            (random_device::_M_init, random_device::_M_init_pretr1): Use new
            function for bad tokens.
            (random_device::_M_getval): Use new function for read errors.
            * testsuite/util/testsuite_random.h (random_device_available):
            Change catch handler to use std::system_error.

  parent reply	other threads:[~2023-04-27 10:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 11:38 [Bug libstdc++/105081] New: " redi at gcc dot gnu.org
2022-03-28 11:38 ` [Bug libstdc++/105081] " redi at gcc dot gnu.org
2023-01-18 13:31 ` redi at gcc dot gnu.org
2023-04-26  6:55 ` rguenth at gcc dot gnu.org
2023-04-27 10:29 ` cvs-commit at gcc dot gnu.org [this message]
2023-04-27 10:36 ` redi at gcc dot gnu.org
2023-06-30 14:09 ` cvs-commit 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-105081-4-6E5eW0fcgb@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: link
Be 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).