From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6F15D38418B4; Fri, 24 Jun 2022 13:21:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F15D38418B4 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105931] [12/13 regression] ICE in cxx_eval_constant_expression Date: Fri, 24 Jun 2022 13:21:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.1.1 X-Bugzilla-Keywords: diagnostic, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.2 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2022 13:21:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105931 --- Comment #7 from CVS Commits --- The releases/gcc-12 branch has been updated by Patrick Palka : https://gcc.gnu.org/g:5cf4746c3d4e80a360bd15b31136339d6812597e commit r12-8513-g5cf4746c3d4e80a360bd15b31136339d6812597e Author: Patrick Palka Date: Thu Jun 23 16:36:43 2022 -0400 c++: constexpr folding in unevaluated context [PR105931] Changing the type of N from int to unsigned in decltype82.C (from r13-986-g0ecb6b906f215e) reveals another spot where we perform constexpr evaluation in an unevaluated context for sake of warnings, this time from the call to shorten_compare in cp_build_binary_op, which calls fold_for_warn. We could (and probably should) suppress the shorten_compare warnings when in an unevaluated context, but there's probably other callers of fold_for_warn that are similarly affected. So this patch takes the approach of directly suppressing fold_for_warn when in an unevaluated context. PR c++/105931 gcc/cp/ChangeLog: * expr.cc (fold_for_warn): Don't fold when in an unevaluated context. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/decltype82a.C: New test. (cherry picked from commit b00b95198e6720eb23a2618870d67800f6180fdd)=