coroutines: Partial reversion of r11-437-g5ef067eb14d4.
authorIain Sandoe <iain@sandoe.co.uk>
Thu, 21 May 2020 14:06:53 +0000 (15:06 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 21 May 2020 18:55:26 +0000 (19:55 +0100)
co_returns are statements, not expressions; they do not need
to be wrapped in an EXPR_STMT.

gcc/cp/ChangeLog:

* coroutines.cc (finish_co_return_stmt): Revert change to use
finish_expr_stmt.

gcc/cp/coroutines.cc

index 4cbc0e09994c3fa68aa0cb332905e1ab680f8a20..b79e2c66b702bfda0cee8a7d9750dcc29c4c963d 100644 (file)
@@ -1102,7 +1102,8 @@ finish_co_return_stmt (location_t kw, tree expr)
                " %<co_return%> statement");
 
   expr = build2_loc (kw, CO_RETURN_EXPR, void_type_node, expr, co_ret_call);
-  return finish_expr_stmt (expr);
+  expr = maybe_cleanup_point_expr_void (expr);
+  return add_stmt (expr);
 }
 
 /* We need to validate the arguments to __builtin_coro_promise, since the