diff options
author | Jason Merrill <jason@redhat.com> | 2020-05-11 14:05:46 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-05-11 15:09:24 -0400 |
commit | f3f9cc41a1a793375a9fff09bfb7a103ce259e07 (patch) | |
tree | edeb2d87ef2bbfba8d45ee224690a6737567fc8c | |
parent | 08434b02e2903c60517f64f3bc3070992001d3b5 (diff) |
c++: Remove redundant code.
We walk the lambda captures in cp_walk_subtrees, so we don't also need to
walk them here.
gcc/cp/ChangeLog
2020-05-11 Jason Merrill <jason@redhat.com>
* pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant
walking of capture list.
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f92c6416ee6..adbe287c5dc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2020-05-11 Jason Merrill <jason@redhat.com> + * pt.c (find_parameter_packs_r) [LAMBDA_EXPR]: Remove redundant + walking of capture list. + +2020-05-11 Jason Merrill <jason@redhat.com> + * cp-tree.h (LOOKUP_EXPLICIT_TMPL_ARGS): Remove. * call.c (build_new_function_call): Don't set it. (build_new_method_call_1): Likewise. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index c6091127225..112426af72a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3988,18 +3988,12 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data) case LAMBDA_EXPR: { - /* Look at explicit captures. */ - for (tree cap = LAMBDA_EXPR_CAPTURE_LIST (t); - cap; cap = TREE_CHAIN (cap)) - cp_walk_tree (&TREE_VALUE (cap), &find_parameter_packs_r, ppd, - ppd->visited); /* Since we defer implicit capture, look in the parms and body. */ tree fn = lambda_function (t); cp_walk_tree (&TREE_TYPE (fn), &find_parameter_packs_r, ppd, ppd->visited); cp_walk_tree (&DECL_SAVED_TREE (fn), &find_parameter_packs_r, ppd, ppd->visited); - *walk_subtrees = 0; return NULL_TREE; } |