From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E7913857702; Wed, 3 May 2023 20:59:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E7913857702 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683147588; bh=GwbdDptrlIb/3GtOOD7hTfwaHZKALNEEf8HrIVZXwpI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=selATIhyvJdHG5RR8MccnlgEz5pMMmXx2nr7O4hqvalljiAccN5Ceo3PEdbVmFAV6 y92ihqNSWErMf0BndegnZapV0txuuSQYPMLaMazcweS1UqIfc0dDi2s0yGhELjQkJ4 rLVZLAFDarsgfP8YObX+B4reBFtYuBBfO3skFuJY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/105844] [10/11 Regression] std::lcm(50000, 49999) is UB but accepted in a constexpr due to cast to unsigned Date: Wed, 03 May 2023 20:59:47 +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.1.0 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 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=3D105844 --- Comment #15 from CVS Commits --- The releases/gcc-10 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:b357af31b8d1e93f0f70133e25d3ad4045f7a32b commit r10-11389-gb357af31b8d1e93f0f70133e25d3ad4045f7a32b Author: Jonathan Wakely Date: Wed May 3 21:40:01 2023 +0100 libstdc++: Ensure constexpr std::lcm detects out-of-range result [PR105= 844] On the gcc-10 branch, __glibcxx_assert does not unconditionally check the condition during constant evaluation. This means we need an explicit additional check for std::lcm results that cannot be represented in an unsigned result type. libstdc++-v3/ChangeLog: PR libstdc++/105844 * include/std/numeric (lcm): Ensure out-of-range result is detected in constant evaluation. * testsuite/26_numerics/lcm/105844.cc: Adjust dg-error string.=