On 2/13/20 12:42 AM, Jason Merrill wrote:
While partially instantiating a generic lambda, we can encounter pack
expansions or constexpr if where we can't actually do the substitution
immediately, and instead remember a partial instantiation context
in *_EXTRA_ARGS. This includes any local_specializations used in the
pattern or condition. In this testcase our tree walk wasn't finding the use
of i because we weren't walking into the type of a CONSTRUCTOR. Fixed by
moving the code for doing that from find_parameter_packs_r into
cp_walk_subtrees.
Tested x86_64-pc-linux-gnu, applying to trunk.
2020-02-11 Jason Merrill <ja...@redhat.com>
PR c++/92583
PR c++/92654
* tree.c (cp_walk_subtrees): Walk CONSTRUCTOR types here.
* pt.c (find_parameter_packs_r): Not here.
Another place that is redundant with the code in cp_walk_subtrees:
commit ce23347267daba090f619d61c6a7a749ea5dbeab
Author: Jason Merrill <ja...@redhat.com>
Date: Fri Feb 14 11:37:26 2020 +0100
c++: Remove more dead code.
gcc/cp/ChangeLog
2020-02-14 Jason Merrill <ja...@redhat.com>
PR c++/92583
* pt.c (any_template_parm_r): Remove CONSTRUCTOR handling.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 6e7f4555da8..d19bde7bcbe 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10448,11 +10448,6 @@ any_template_parm_r (tree t, void *data)
WALK_SUBTREE (TREE_OPERAND (t, 1));
break;
- case CONSTRUCTOR:
- if (TREE_TYPE (t))
- WALK_SUBTREE (TREE_TYPE (t));
- break;
-
case PARM_DECL:
/* A parameter or constraint variable may also depend on a template
parameter without explicitly naming it. */