https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116327
Bug ID: 116327
Summary: ICE in coroutine with parameter preview on lambda with
captures.
Product: gcc
Version: 14.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jehelset at gmail dot com
Target Milestone: ---
ICE from `expand_expr_real_1` in `expr.cc:11376`
Seems to happen after 066c7893eae, in particular:
@@ -4618,13 +4618,8 @@ morph_fn_to_coro (tree orig, tree *resumer, tree
*destroyer)
if (parm_i->this_ptr || parm_i->lambda_cobj)
{
/* We pass a reference to *this to the allocator lookup. */
- tree tt = TREE_TYPE (TREE_TYPE (arg));
- tree this_ref = build1 (INDIRECT_REF, tt, arg);
- tt = cp_build_reference_type (tt, false);
- this_ref = convert_to_reference (tt, this_ref, CONV_STATIC,
- LOOKUP_NORMAL , NULL_TREE,
- tf_warning_or_error);
- vec_safe_push (args, convert_from_reference (this_ref));
+ tree this_ref = cp_build_fold_indirect_ref (arg);
+ vec_safe_push (args, this_ref);
}
else
vec_safe_push (args, convert_from_reference (arg));