From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B4FF63861826; Thu, 1 Feb 2024 15:50:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4FF63861826 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706802617; bh=oI37aen3WP/n8luFMw604emJC1P3k6yiIwD4qoG45xM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SbluWSq6g4g+4thC93GEUNUJ/zMS3TOvjFNxcAZG9/lRXDxBO2rLDNaROJLcd1SMA 0FRB3blzTQ3/govwPFhVLCPYmDNbwP42eGSwV39FpgCkAW0RAwwfhQf5iO5ru22d2G NdewXDKDAzzD0Gac0Ae/hxRnIrPyz4m2zpv4bE+I= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112437] ICE with throw inside concept sometimes and -std=c++20 Date: Thu, 01 Feb 2024 15:50:17 +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: 14.0 X-Bugzilla-Keywords: 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: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D112437 --- Comment #5 from GCC Commits --- The releases/gcc-12 branch has been updated by Marek Polacek : https://gcc.gnu.org/g:4617c9b6eb22062a319dcdbddb8c3cebce398c15 commit r12-10124-g4617c9b6eb22062a319dcdbddb8c3cebce398c15 Author: Marek Polacek Date: Wed Jan 31 17:33:26 2024 -0500 c++: ICE with throw inside concept [PR112437] We crash in the loop at the end of treat_lvalue_as_rvalue_p for code like template concept Throwable =3D requires(T x) { throw x; }; because the code assumes that we eventually reach sk_function_parms or sk_try and bail, but in a concept we're in a sk_namespace. We're already checking sk_try so we don't crash in a function-try-block, but I've added a test anyway. PR c++/112437 gcc/cp/ChangeLog: * typeck.cc (treat_lvalue_as_rvalue_p): Bail out on sk_namespac= e in the move on throw of parms loop. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-throw1.C: New test. * g++.dg/eh/throw4.C: New test. (cherry picked from commit 65b105b4f399559685200e1598ead8c7d0935c04)=