aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-07-11 21:02:31 +0000
committerMark Mitchell <mark@codesourcery.com>2004-07-11 21:02:31 +0000
commit10fc92f8aac37610c04da9e1b0b92e43236d8d4a (patch)
treeb47ca1ae95a6c5cdd74d9e1827122aa0590299ed /gcc/cp/search.c
parent9f7ebddb320433466f171e5ce16feb75e6e6024b (diff)
* cp-tree.h (saved_scope): Make old_bindings a vector.
(unuse_fields): Remove. * name-lookup.h (cxx_saved_binding): Define it. * class.c (pushclass): Don't use unuse_fields. * name-lookup.c (cxx_saved_binding_make): Remove. (store_binding): Add new bindings to a vector, using an accumulator style, rather than adding them to a list. (store_bindings): Adjust accordingly. (store_class_bindings): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. * optimize.c (maybe_clone_body): Must push_to_top_level and pop_from_top_level calls outside of loop. * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope calls here from cp_parser_late_parsing_default_args. (cp_parser_save_default_args): Record the class type in which the function is declared. (cp_parser_late_parsing_default_args): Do not call push_nested_class/pop_nested_class. * search.c (dfs_unuse_fields): Remove. (unuse_fields): Remove. * g++.dg/parse/defarg8.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@84530 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 0c9188dfa22..da9a7cfdc7f 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -88,7 +88,6 @@ static tree dfs_debug_unmarkedp (tree, int, void *);
static tree dfs_debug_mark (tree, void *);
static tree dfs_push_type_decls (tree, void *);
static tree dfs_push_decls (tree, void *);
-static tree dfs_unuse_fields (tree, void *);
static tree add_conversions (tree, void *);
static int look_for_overrides_r (tree, tree);
static struct search_level *push_search_level (struct stack_level *,
@@ -2247,45 +2246,6 @@ push_class_decls (tree type)
dfs_walk (TYPE_BINFO (type), dfs_push_decls, marked_pushdecls_p, 0);
}
-/* Here's a subroutine we need because C lacks lambdas. */
-
-static tree
-dfs_unuse_fields (tree binfo, void *data ATTRIBUTE_UNUSED)
-{
- tree type = TREE_TYPE (binfo);
- tree fields;
-
- if (TREE_CODE (type) == TYPENAME_TYPE)
- fields = TYPENAME_TYPE_FULLNAME (type);
- else if (TREE_CODE (type) == TYPEOF_TYPE)
- fields = TYPEOF_TYPE_EXPR (type);
- else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM
- || TREE_CODE (type) == TEMPLATE_TEMPLATE_PARM
- || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM)
- fields = TEMPLATE_TYPE_PARM_INDEX (type);
- else
- fields = TYPE_FIELDS (type);
-
- for (; fields; fields = TREE_CHAIN (fields))
- {
- if (TREE_CODE (fields) != FIELD_DECL || DECL_ARTIFICIAL (fields))
- continue;
-
- TREE_USED (fields) = 0;
- if (DECL_NAME (fields) == NULL_TREE
- && ANON_AGGR_TYPE_P (TREE_TYPE (fields)))
- unuse_fields (TREE_TYPE (fields));
- }
-
- return NULL_TREE;
-}
-
-void
-unuse_fields (tree type)
-{
- dfs_walk (TYPE_BINFO (type), dfs_unuse_fields, unmarkedp, 0);
-}
-
void
pop_class_decls (void)
{