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

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

https://gcc.gnu.org/g:da999d938e516ff12b39a0aa7e8f6d97fbee60df

commit r9-10177-gda999d938e516ff12b39a0aa7e8f6d97fbee60df
Author: Jason Merrill <ja...@redhat.com>
Date:   Sat Apr 3 01:07:36 2021 -0400

    c++: NRV in lambda in template [PR91217]

    tsubst_lambda_expr was producing a function with two blocks that claimed to
    be the outermost block in the function body, one from the call to
    start_lambda_function in tsubst_lambda_expr, and one from tsubsting the
    block added by start_lambda_function when we first parsed the lambda.  This
    messed with the named return value optimization, which only works for
    variables in the outermost block.

    gcc/cp/ChangeLog:

            PR c++/91217
            * pt.c (tsubst_lambda_expr): Skip the body block from
            DECL_SAVED_TREE.

    gcc/testsuite/ChangeLog:

            PR c++/91217
            * g++.dg/opt/nrv20.C: New test.
  • [Bug c++/91217] [9 Regression] ... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to