+2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
+
+ * coroutines.cc (transform_await_wrapper): Set actor funcion as
+ new context of label_decl.
+ (build_actor_fn): Fill new field of await_xform_data.
+
2020-02-02 Marek Polacek <polacek@redhat.com>
PR c++/93530 - ICE on invalid alignas in a template.
struct await_xform_data
{
+ tree actor_fn; /* Decl for context. */
tree actor_frame;
tree promise_proxy;
tree real_promise;
static tree
transform_await_wrapper (tree *stmt, int *do_subtree, void *d)
{
+ /* Set actor function as new DECL_CONTEXT of label_decl. */
+ struct await_xform_data *xform = (struct await_xform_data *) d;
+ if (TREE_CODE (*stmt) == LABEL_DECL
+ && DECL_CONTEXT (*stmt) != xform->actor_fn)
+ DECL_CONTEXT (*stmt) = xform->actor_fn;
+
if (TREE_CODE (*stmt) != CO_AWAIT_EXPR && TREE_CODE (*stmt) != CO_YIELD_EXPR)
return NULL_TREE;
tree await_expr = *stmt;
- await_xform_data *xform = (await_xform_data *) d;
-
*stmt = transform_await_expr (await_expr, xform);
if (*stmt == error_mark_node)
*do_subtree = 0;
decide where to put things. */
await_xform_data xform
- = {actor_frame, promise_proxy, ap, self_h_proxy, ash};
+ = {actor, actor_frame, promise_proxy, ap, self_h_proxy, ash};
/* Get a reference to the initial suspend var in the frame. */
transform_await_expr (initial_await, &xform);
+2020-02-03 Jun Ma <JunMa@linux.alibaba.com>
+
+ * g++.dg/coroutines/co-await-04-control-flow.C: Add label.
+
2020-02-02 Marek Polacek <polacek@redhat.com>
PR c++/93530 - ICE on invalid alignas in a template.