https://gcc.gnu.org/g:88cd641c38a2a4ed69fc90098c9480e17904b1a2
commit r17-419-g88cd641c38a2a4ed69fc90098c9480e17904b1a2 Author: Patrick Palka <[email protected]> Date: Sat May 9 09:01:11 2026 -0400 c++: always walk DECL_VALUE_EXPR in cp_genericize_r [PR121500] 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. Reviewed-by: Jason Merrill <[email protected]> Diff: --- 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);
