aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2020-06-05 15:09:39 +0100
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:10:39 -0300
commit1eec73b0c49732d081fe3a23e8f6d7c3f28227a3 (patch)
tree373ffe4e0da0a18796484e4653bf592658f38003
parent5b084b6d1029e1ed240e7c0e445bcae1a717b01d (diff)
downloadgcc-1eec73b0c49732d081fe3a23e8f6d7c3f28227a3.zip
gcc-1eec73b0c49732d081fe3a23e8f6d7c3f28227a3.tar.gz
gcc-1eec73b0c49732d081fe3a23e8f6d7c3f28227a3.tar.bz2
coroutines: co_returns are statements, not expressions.
This corrects an error in the CO_RETURN_EXPR tree class. gcc/cp/ChangeLog: * cp-tree.def (CO_RETURN_EXPR): Correct the class to use tcc_statement.
-rw-r--r--gcc/cp/cp-tree.def4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index 1454802..99851eb 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -594,9 +594,9 @@ DEFTREECODE (CO_YIELD_EXPR, "co_yield", tcc_expression, 2)
/* The co_return expression is used to support coroutines.
Op0 is the original expr, can be void (for use in diagnostics)
- Op2 is the promise return_xxxx call for Op0. */
+ Op1 is the promise return_xxxx call for for the expression given. */
-DEFTREECODE (CO_RETURN_EXPR, "co_return", tcc_expression, 2)
+DEFTREECODE (CO_RETURN_EXPR, "co_return", tcc_statement, 2)
/*
Local variables: