https://gcc.gnu.org/g:b6094031eea96c116a386e7112ee79a6bde5207e
commit r14-11739-gb6094031eea96c116a386e7112ee79a6bde5207e Author: Jason Merrill <ja...@redhat.com> Date: Mon Dec 23 19:57:56 2024 -0500 c++: fix conversion issues back-port the coroutine part of this. Some issues caught by a check from another patch: In build_ramp_function, we're assigning REFERENCE_TYPE things, so we need to build the assignment directly rather than rely on functions that implement C++ semantics. gcc/cp/ChangeLog: * coroutines.cc (cp_coroutine_transform::build_ramp_function): Build INIT_EXPR directly. (cherry picked from commit dd3f3c71df66ed6fd3872ab780f5813831100d1c) Diff: --- gcc/cp/coroutines.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc index 77067be45ad4..09e2f3410627 100644 --- a/gcc/cp/coroutines.cc +++ b/gcc/cp/coroutines.cc @@ -5093,8 +5093,8 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer) if (parm.rv_ref || parm.pt_ref) /* Initialise the frame reference field directly. */ - r = cp_build_modify_expr (fn_start, TREE_OPERAND (fld_idx, 0), - INIT_EXPR, arg, tf_warning_or_error); + r = build2 (INIT_EXPR, TREE_TYPE (arg), + TREE_OPERAND (fld_idx, 0), arg); else { r = forward_parm (arg);