2020-05-05 Nathan Sidwell <nathan@acm.org>
PR c++/94807
* coroutines.cc (morph_fn_to_coro): Just check for
closure_identifier.
* pt.c (tsubst_function_decl): Update lambda fn's this_ptr name.
@@ -3736,8 +3736,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer)
closure object is named 'this' instead of '__closure'. */
if (lambda_p)
{
- parm.lambda_cobj = parm.this_ptr
- || (DECL_NAME (arg) == closure_identifier);
+ parm.lambda_cobj = DECL_NAME (arg) == closure_identifier;
parm.this_ptr = false;
}
else
@@ -13821,6 +13821,7 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
if (closure)
{
tree tparm = build_this_parm (r, closure, type_memfn_quals (type));
+ DECL_NAME (tparm) = closure_identifier;
DECL_CHAIN (tparm) = parms;
parms = tparm;
}