From: Iain Sandoe Date: Wed, 24 Jul 2024 19:59:10 +0000 (+0100) Subject: c++, coroutines: Fix a typo in checking for void expression types. X-Git-Tag: basepoints/gcc-16~6861 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=370a0dee5556941c215c2b3fc61a8bcc40ae4942;p=thirdparty%2Fgcc.git 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 --- 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))