From: Jason Merrill Date: Tue, 24 Dec 2024 00:57:56 +0000 (-0500) Subject: c++: fix conversion issues X-Git-Tag: releases/gcc-14.3.0~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6094031eea96c116a386e7112ee79a6bde5207e;p=thirdparty%2Fgcc.git 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 --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);