]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
coroutines: co_returns are statements, not expressions.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 26 Jul 2020 14:09:39 +0000 (15:09 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 29 Jul 2020 07:20:48 +0000 (08:20 +0100)
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.

(cherry picked from commit 608832716e27ca356ee38d14ae30b3ab525884ea)

gcc/cp/cp-tree.def

index 1454802bf68e8f62fd153261fb14b3a696cb788a..99851eb780f85cde5508e5fd2fa42327d49682e0 100644 (file)
@@ -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: