diff options
author | Jason Merrill <jason@redhat.com> | 2020-03-14 17:10:39 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-03-14 17:13:25 -0400 |
commit | b3b0c671cc341fd04afc045a8d42d7a845d7f73c (patch) | |
tree | 317dc05d5c474274de96ed7db49122a63a509690 /gcc/cp | |
parent | c393c99d3dc8329dc1a36011e70faa9700185051 (diff) | |
download | gcc-b3b0c671cc341fd04afc045a8d42d7a845d7f73c.zip gcc-b3b0c671cc341fd04afc045a8d42d7a845d7f73c.tar.gz gcc-b3b0c671cc341fd04afc045a8d42d7a845d7f73c.tar.bz2 |
c++: Find parameter pack in typedef in lambda [92909].
find_parameter_packs_r doesn't look through typedefs, which is normally
correct, but that means we need to handle their declarations specially.
gcc/cp/ChangeLog
2020-03-14 Jason Merrill <jason@redhat.com>
PR c++/92909
* pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk
DECL_ORIGINAL_TYPE of a typedef.
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 16 |
2 files changed, 18 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b4fa150..bb7f590 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2020-03-14 Jason Merrill <jason@redhat.com> + PR c++/92909 + * pt.c (find_parameter_packs_r): [DECL_EXPR]: Walk + DECL_ORIGINAL_TYPE of a typedef. + +2020-03-14 Jason Merrill <jason@redhat.com> + PR c++/93248 * pt.c (build_deduction_guide): Clear cp_unevaluated_operand for substituting DECL_ARGUMENTS. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 0f3c2ad..bd2f9be 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3916,10 +3916,18 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data) return NULL_TREE; case DECL_EXPR: - /* Ignore the declaration of a capture proxy for a parameter pack. */ - if (is_capture_proxy (DECL_EXPR_DECL (t))) - *walk_subtrees = 0; - return NULL_TREE; + { + tree decl = DECL_EXPR_DECL (t); + /* Ignore the declaration of a capture proxy for a parameter pack. */ + if (is_capture_proxy (decl)) + *walk_subtrees = 0; + if (is_typedef_decl (decl)) + /* Since we stop at typedefs above, we need to look through them at + the point of the DECL_EXPR. */ + cp_walk_tree (&DECL_ORIGINAL_TYPE (decl), + &find_parameter_packs_r, ppd, ppd->visited); + return NULL_TREE; + } case TEMPLATE_DECL: if (!DECL_TEMPLATE_TEMPLATE_PARM_P (t)) |