From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0D5C53858D32; Mon, 19 Sep 2022 19:01:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D5C53858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663614096; bh=kVVAlMOCScZmxX+a6Wdj9zXRnL7XiPEwZPM/aqIGbnE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Wk2LP+MpNLlTponkCGaK88Mc32AAy1/3cDSSbugwGqR5mlPak+U7JPye+DVd7scVi OKCINgN2HDFdM+jgsTXNROiaF5wz2FZS0CnFa3N5F9bdOq/4jpoWXshDxxI3kMKG6H d3ziSe+empBeqZz37Ybilgl2k1tk4J/xfn44gs3o= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106812] Throwing a non-copyable exception Date: Mon, 19 Sep 2022 19:01:35 +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.2.0 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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=3D106812 --- Comment #3 from Marek Polacek --- The difference between #3 and not-#3 is that without the NSDMI, S isn't TYPE_NEEDS_CONSTRUCTING, which makes a difference in initialize_handler_par= m: 339 /* If the constructor for the catch parm exits via an exception, we 340 must call terminate. See eh23.C. */ 341 if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))) 342 { 343 /* Generate the copy constructor call directly so we can wrap it. 344 See also expand_default_init. */ 345 init =3D ocp_convert (TREE_TYPE (decl), init, 346 CONV_IMPLICIT|CONV_FORCE_TEMP, 0, 347 tf_warning_or_error);=