c++, coroutines: Fix a typo in checking for void expression types.

The current code fails to check for void expression types because it does
not looup the type.  Fixed thus.

gcc/cp/ChangeLog:

	* coroutines.cc (replace_continue): Look up expression type.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
This commit is contained in:
Iain Sandoe
2024-08-02 11:36:22 +01:00
committed by Iain Sandoe
parent 33baa20c5c
commit 370a0dee55
+1 -1
View File
@@ -3433,7 +3433,7 @@ replace_continue (tree *stmt, int *do_subtree, void *d)
tree expr = *stmt;
if (TREE_CODE (expr) == CLEANUP_POINT_EXPR)
expr = TREE_OPERAND (expr, 0);
if (CONVERT_EXPR_P (expr) && VOID_TYPE_P (expr))
if (CONVERT_EXPR_P (expr) && VOID_TYPE_P (TREE_TYPE (expr)))
expr = TREE_OPERAND (expr, 0);
STRIP_NOPS (expr);
if (!STATEMENT_CLASS_P (expr))