From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 791243882074; Fri, 30 Jun 2023 14:09:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 791243882074 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688134165; bh=nhH3I1Lns4fkS/UMdUgdwwaUXzNNy+rUWwbrtvpiIaQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ll0SpCvW3T9Us7heX+cTsPqDiPpkleHXzKAY++se7rWrr8bhgCMt4MHT3abb9ceQg FORIQFl9oJHlhN1bHFzHiW84P7muIsm2uV4xWuLXwusTYGioPIqQRuWkY76c6RvYWA Boz3B+mh/l15YZ5zEBrXwCJn3PkZTVvjTvhMLoxQ= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/105081] Make std::random_device throw std::system_error Date: Fri, 30 Jun 2023 14:09:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105081 --- Comment #5 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:d6a6a4ea086d6af97bd7fbd482f51df41c265b79 commit r14-2217-gd6a6a4ea086d6af97bd7fbd482f51df41c265b79 Author: Jonathan Wakely Date: Fri Jun 30 14:37:59 2023 +0100 libstdc++: Make std::random_device throw more std::system_error [PR1050= 81] In r14-289-gf9412cedd6c0e7 I made the std::random_device constructor throw std::system_error for unrecognized tokens. But it still throws std::runtime_error for a token such as "rdseed" that is recognized but not supported at runtime by the CPU the program is running on. With this change we throw std::system_error for those cases too. This fixes the following failures on Intel CPUs withour rdseed support: FAIL: 26_numerics/random/random_device/94087.cc execution test FAIL: 26_numerics/random/random_device/cons/token.cc execution test FAIL: 26_numerics/random/random_device/entropy.cc execution test libstdc++-v3/ChangeLog: PR libstdc++/105081 * src/c++11/random.cc (random_device::_M_init): Throw std::system_error when the requested device is a valid token but not available at runtime.=