diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2020-05-21 15:06:53 +0100 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2020-05-21 19:55:26 +0100 |
commit | f898793b4545483adaf62c5efbc78cee518884e6 (patch) | |
tree | 7838a3cc7aabe8a347badfae9525685b96f91d14 /gcc | |
parent | 149c8c7c27a17a2941d07e2f76b1e1c823e2fa80 (diff) | |
download | gcc-f898793b4545483adaf62c5efbc78cee518884e6.zip gcc-f898793b4545483adaf62c5efbc78cee518884e6.tar.gz gcc-f898793b4545483adaf62c5efbc78cee518884e6.tar.bz2 |
coroutines: Partial reversion of r11-437-g5ef067eb14d4.
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/coroutines.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc index 4cbc0e0..b79e2c6 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 |