aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2024-07-24 20:59:10 +0100
committerIain Sandoe <iains@gcc.gnu.org>2024-08-02 11:36:22 +0100
commit370a0dee5556941c215c2b3fc61a8bcc40ae4942 (patch)
tree0d6fc96ede2ecd289358afe85512ee2b1f22268d
parent33baa20c5cdcf5ff8164606115f00aa30f559312 (diff)
downloadgcc-370a0dee5556941c215c2b3fc61a8bcc40ae4942.zip
gcc-370a0dee5556941c215c2b3fc61a8bcc40ae4942.tar.gz
gcc-370a0dee5556941c215c2b3fc61a8bcc40ae4942.tar.bz2
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>
-rw-r--r--gcc/cp/coroutines.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 91bbe6b..9c1e5f0 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))