https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53288

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:208c6678c25bd9a11e6c5911a4c123cb6b7f3d6e

commit r13-5283-g208c6678c25bd9a11e6c5911a4c123cb6b7f3d6e
Author: Jason Merrill <ja...@redhat.com>
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 operation.
    These rules were clarified in C++20 by CWG1299.

    There are other cases that also need to be handled under CWG1299, but are
    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.

Reply via email to