[pushed] coroutines: Partial reversion of r11-437-g5ef067eb14d4.

Message ID 0ADB634B-DBD3-4428-BC49-C5409D6F216F@sandoe.co.uk
State New
Headers show
Series
  • [pushed] coroutines: Partial reversion of r11-437-g5ef067eb14d4.
Related show

Commit Message

Iain Sandoe May 21, 2020, 7:49 p.m.
Hi

I got a bit over-zealous in the attempt to make better use of the higher-
level APIs in the c++ FE,  this reverts that part of the change,

Tested on x86_64-darwin,
applied to master,
thanks
Iain

-- 
2.24.1

Patch

====

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 | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 4cbc0e09994..b79e2c66b70 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -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