diff mbox series

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

Message ID 20240802103910.40918-1-iain@sandoe.co.uk
State New
Headers show
Series [pushed] c++, coroutines: Fix a typo in checking for void expression types. | expand

Commit Message

Iain Sandoe Aug. 2, 2024, 10:39 a.m. UTC
tested on x86_64-darwin and linux, pushed to trunk as obvious, thanks,
Iain

--- 8< ---

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

gcc/cp/ChangeLog:

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

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
---
 gcc/cp/coroutines.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 91bbe6b0a0e..9c1e5f0c5d7 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -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))