]> gcc.gnu.org Git - gcc.git/commitdiff
c++, coroutines: Fix a typo in checking for void expression types.
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 24 Jul 2024 19:59:10 +0000 (20:59 +0100)
committerIain Sandoe <iains@gcc.gnu.org>
Fri, 2 Aug 2024 10:36:22 +0000 (11:36 +0100)
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>
gcc/cp/coroutines.cc

index 91bbe6b0a0eb823e3cf3a258154d2a1644c5e3b6..9c1e5f0c5d78b2b8c96926fc9695abc0668df1a3 100644 (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))
This page took 0.071034 seconds and 5 git commands to generate.