From b6094031eea96c116a386e7112ee79a6bde5207e Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 23 Dec 2024 19:57:56 -0500 Subject: [PATCH] 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) --- 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 77067be45ad..09e2f341062 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); -- 2.47.2