From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BB1C385802E; Thu, 1 Feb 2024 14:00:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BB1C385802E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706796056; bh=fmEP6nWF2OIFIwOWVJedmRQOvSpNCtle8X61V5MWBpQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cnZh73l+ct5jVLZOGhDoER+Tj9OhPptOWyA+hfm5SnI7apJ/+dP0iU0x6Ewhpmc7A Kdmt1bNLcjaNymQ639+GH4hhNwc29/OZpiKaRnxsjHK4KwdV2bhm++9Ee+uKZmQTi8 0m+NDtajYbBFYDbH87GJbNKgt/T+uOjZVn7Ynqmk= 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 14:00:52 +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 #3 from GCC Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:65b105b4f399559685200e1598ead8c7d0935c04 commit r14-8697-g65b105b4f399559685200e1598ead8c7d0935c04 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.=