On 5/7/26 6:39 PM, Patrick Palka wrote:
tested on x86_64-pc-linux-gnu, does this look OK for trunk?
OK.
-- >8 --
This patch makes cp_genericize_r unconditionally walk DECL_VALUE_EXPR
as per the TODO from r16-7523.
PR c++/121500
gcc/cp/ChangeLog:
* cp-gimplify.cc (cp_genericize_r): Unconditionally walk
DECL_VALUE_EXPR.
---
gcc/cp/cp-gimplify.cc | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc
index 85a3e98100f6..6845134c01d1 100644
--- a/gcc/cp/cp-gimplify.cc
+++ b/gcc/cp/cp-gimplify.cc
@@ -1955,13 +1955,7 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void
*data)
if ((TREE_CODE (stmt) == VAR_DECL
|| TREE_CODE (stmt) == PARM_DECL
|| TREE_CODE (stmt) == RESULT_DECL)
- && DECL_HAS_VALUE_EXPR_P (stmt)
- /* Walk DECL_VALUE_EXPR mainly for benefit of xobj lambdas so that we
- adjust any invisiref object parm uses within the capture proxies.
- TODO: For GCC 17 do this walking unconditionally. */
- && current_function_decl
- && DECL_XOBJ_MEMBER_FUNCTION_P (current_function_decl)
- && LAMBDA_FUNCTION_P (current_function_decl))
+ && DECL_HAS_VALUE_EXPR_P (stmt))
{
tree ve = DECL_VALUE_EXPR (stmt);
cp_walk_tree (&ve, cp_genericize_r, data, NULL);