Message ID | 8291EEA1-37E7-4E82-B2D7-50646D0BC524@sandoe.co.uk |
---|---|
State | New |
Headers | show |
Series | coroutines: Ensure distinct DTOR trees [PR95137]. | expand |
On 5/22/20 7:19 AM, Iain Sandoe wrote: > Hi > > This is almost obvious - except perhaps I’m missing some more > efficient way of doing it; it seems less than ideal to have to build the > ctor call twice with exactly the same inputs. > > If there’s no better way …. ok. nathan
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc index b79e2c66b70..18f74d034b7 100644 --- a/gcc/cp/coroutines.cc +++ b/gcc/cp/coroutines.cc @@ -1468,19 +1468,13 @@ expand_one_await_expression (tree *stmt, tree *await_expr, void *d) tree resume_label = create_named_label_with_ctx (loc, buf, actor); tree empty_list = build_empty_stmt (loc); - tree dtor = NULL_TREE; tree await_type = TREE_TYPE (var); - if (needs_dtor) - dtor = build_special_member_call (var, complete_dtor_identifier, NULL, - await_type, LOOKUP_NORMAL, - tf_warning_or_error); - tree stmt_list = NULL; tree t_expr = STRIP_NOPS (expr); tree r; tree *await_init = NULL; if (t_expr == var) - dtor = NULL_TREE; + needs_dtor = false; else {