From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B568A3858407; Mon, 23 Jan 2023 00:36:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B568A3858407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674434194; bh=qVvoKWSEm8SRlHH6g0eGsdGNWOuY2IPt5QrKPk93w5I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aRODMIgAAsADs7qPbvFw01opeAGf897K5qb8zy2pY8dO5Bt6ptAPBb0TJpair+wqB 2CcMb1Q7KTmg1Sf69blnpvZrJy+vauOMqDTuoZW+jeoJ89b6kd+89Ucmuh+R59kMlz MggpR/xB+iRNBzA6b/OXyjB3dHXiQckFYgske5FI= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53288] [C++11] Lifetime of temporary object backing pointer-to-member expression not extended Date: Mon, 23 Jan 2023 00:36:31 +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: 4.7.0 X-Bugzilla-Keywords: wrong-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: jason 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=3D53288 --- Comment #5 from CVS Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:208c6678c25bd9a11e6c5911a4c123cb6b7f3d6e commit r13-5283-g208c6678c25bd9a11e6c5911a4c123cb6b7f3d6e Author: Jason Merrill Date: Tue Dec 20 16:27:43 2022 -0500 c++: lifetime extension with .* expression [PR53288] This PR points out a case where we are not extending the lifetime of a temporary when the subobject is denoted by a pointer-to-member operatio= n. These rules were clarified in C++20 by CWG1299. There are other cases that also need to be handled under CWG1299, but a= re not fixed by this patch. PR c++/53288 DR 1299 gcc/cp/ChangeLog: * call.cc (extend_ref_init_temps_1): Handle ptrmem expression. gcc/testsuite/ChangeLog: * g++.dg/init/lifetime4.C: New test.=