From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 883C63858D1E; Fri, 2 Sep 2022 07:14:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 883C63858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662102855; bh=O1eTh6B1hEe5yImFg2LxEMWFuma4ORiNfEIc9DFhPE0=; h=From:To:Subject:Date:From; b=h97UW0u+4RG0KpFy1O8Nx3Y4xTZE+SsOiowfQjo7zmJBo7zLUdhuF7qpKinCSsXWz Rn6BW4euXKXSMrqlnAqMq9IzQpmWnJtPn4XvHyhtj3TYggkD++wDTNypL/6T3vOMJb 1nkBQhidAz3VXhzHPDyW09CYZ2ylRg1f0NkjK4j0= From: "jens.maurer at gmx dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106812] New: Throwing a non-copyable exception Date: Fri, 02 Sep 2022 07:14:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jens.maurer at gmx dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D106812 Bug ID: 106812 Summary: Throwing a non-copyable exception Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jens.maurer at gmx dot net Target Milestone: --- gcc accepts the following program: struct S { S() =3D default; S(const S&) =3D delete; // int x =3D 0; // #3 }; int main() { try { throw S(); // #1 } catch (S s) { // #2 return 1; } } but it is ill-formed at #1 according to [except.throw] p5. Curiously, if line #3 is added, gcc flags an error at #2 (but not at #1).=