aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2020-02-07 10:31:30 -0500
committerJason Merrill <jason@redhat.com>2020-02-07 14:20:46 -0500
commit1e042b396e2a84e3ee17bc52def1bf241cb7d248 (patch)
tree4bedd89b18a63e06634d0705233eac45ce1c1244 /gcc/cp/error.c
parentc8dd2446f597e6d1581414a9c02ff329285181a9 (diff)
downloadgcc-1e042b396e2a84e3ee17bc52def1bf241cb7d248.zip
gcc-1e042b396e2a84e3ee17bc52def1bf241cb7d248.tar.gz
gcc-1e042b396e2a84e3ee17bc52def1bf241cb7d248.tar.bz2
c++: Fix use of local in constexpr if.
extract_local_specs wasn't finding the mention of 'an' as a template argument because we weren't walking into template arguments. So here I changed cp_walk_subtrees to do so--only walking into template arguments in the spelling of the type or expression, not any hidden behind typedefs. The change to use typedef_variant_p avoids looking through typedefs spelled with 'typedef' as well as those spelled with 'using'. And then I removed some now-redundant code for walking into template arguments in a couple of walk_tree callbacks. PR c++/92654 * tree.c (cp_walk_subtrees): Walk into type template arguments. * cp-tree.h (TYPE_TEMPLATE_INFO_MAYBE_ALIAS): Use typedef_variant_p instead of TYPE_ALIAS_P. * pt.c (push_template_decl_real): Likewise. (find_parameter_packs_r): Likewise. Remove dead code. * error.c (find_typenames_r): Remove dead code.
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 973b303..ab8638f 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1526,12 +1526,6 @@ find_typenames_r (tree *tp, int *walk_subtrees, void *data)
if (mv && (mv == *tp || !d->p_set->add (mv)))
vec_safe_push (d->typenames, mv);
- /* Search into class template arguments, which cp_walk_subtrees
- doesn't do. */
- if (CLASS_TYPE_P (*tp) && CLASSTYPE_TEMPLATE_INFO (*tp))
- cp_walk_tree (&CLASSTYPE_TI_ARGS (*tp), find_typenames_r,
- data, d->p_set);
-
return NULL_TREE;
}