https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114707
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:5bc731b83b51910dc7f7cacddb4257a16d62ee38 commit r15-868-g5bc731b83b51910dc7f7cacddb4257a16d62ee38 Author: Marek Polacek <pola...@redhat.com> Date: Wed May 22 16:28:02 2024 -0400 c++: mark TARGET_EXPRs for function arguments eliding [PR114707] Coming back to our discussion in <https://gcc.gnu.org/pipermail/gcc-patches/2024-April/649426.html>: TARGET_EXPRs that initialize a function argument are not marked TARGET_EXPR_ELIDING_P even though gimplify_arg drops such TARGET_EXPRs on the floor. To work around it, I added a pset to replace_placeholders_for_class_temp_r, but it would be best to just rely on TARGET_EXPR_ELIDING_P. PR c++/114707 gcc/cp/ChangeLog: * call.cc (convert_for_arg_passing): Call set_target_expr_eliding. * typeck2.cc (replace_placeholders_for_class_temp_r): Don't use pset. (digest_nsdmi_init): Call cp_walk_tree_without_duplicates instead of cp_walk_tree. Reviewed-by: Jason Merrill <ja...@redhat.com>