aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 5000216..be33d41 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -4933,6 +4933,14 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func,
}
break;
+ case LAMBDA_EXPR:
+ /* Don't walk into the body of the lambda, but the capture initializers
+ are part of the enclosing context. */
+ for (tree cap = LAMBDA_EXPR_CAPTURE_LIST (*tp); cap;
+ cap = TREE_CHAIN (cap))
+ WALK_SUBTREE (TREE_VALUE (cap));
+ break;
+
default:
return NULL_TREE;
}