aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2003-01-14 13:40:53 +0000
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>2003-01-14 13:40:53 +0000
commitcf22909ceee710ab2f61b4d689b02cff8d62ec79 (patch)
tree90148a1690538fe0373d3e426aeda784a80a6a4f /gcc/cp/search.c
parenta686ea5ba7a26bb5c755b5d65d05155770e5de5a (diff)
downloadgcc-cf22909ceee710ab2f61b4d689b02cff8d62ec79.zip
gcc-cf22909ceee710ab2f61b4d689b02cff8d62ec79.tar.gz
gcc-cf22909ceee710ab2f61b4d689b02cff8d62ec79.tar.bz2
config-lang.in: Add semantics.c to gtfiles.
* config-lang.in: Add semantics.c to gtfiles. * cp-tree.h (flagged_type_tree_s): Remove lookups field. (saved_scope): Likewise. (type_lookups): Remove. (deferred_access): New structure. (type_access_control): Remove. (save_type_access_control): Likewise. (reset_type_access_control): Likewise. (decl_type_access_control): Likewise. (push_deferring_access_checks): Declare. (resume_deferring_access_checks): Likewise. (stop_deferring_access_checks): Likewise. (pop_deferring_access_checks): Likewise. (get_deferred_access_checks): Likewise. (pop_to_parent_deferring_access_checks): Likewise. (perform_deferred_access_checks): Likewise. (perform_or_defer_access_check): Likewise. * decl.c (make_typename_type): Use perform_or_defer_access_check. (make_unbound_class_template): Likewise. (grokdeclarator): Don't call decl_type_access_control. * parser.c (cp_parser_context): Remove deferred_access_checks and deferring_access_checks_p fields. (cp_parser_context_new): Adjust. (cp_parser): Remove access_checks_lists. (cp_parser_defer_access_check): Remove. (cp_parser_start_deferring_access_checks): Remove. (cp_parser_stop_deferring_access_checks): Remove. (cp_parser_perform_deferred_access_checks): Remove. (cp_parser_nested_name_specifier_opt): Use new deferred access functions. (cp_parser_simple_declaration): Likewise. (cp_parser_template_id): Likewise. (cp_parser_function_definition): Likewise. (cp_parser_class_specifier): Likewise. (cp_parser_lookup_name): Likewise. (cp_parser_single_declaration): Likewise. (cp_parser_pre_parsed_nested_name_specifier): Likewise. (cp_parser_parse_tentatively): Likewise. (cp_parser_parse_definitely): Likewise. (yyparse): Likewise. (cp_parser_init_declarator): Remove access_checks parameter. Use new deferred access functions. (cp_parser_function_definition_from_specifiers_and_declarator): Likewise. (cp_parser_class_head): Remove deferring_access_checks_p and saved_access_checks parameters. Use new deferred access functions. (cp_parser_member_specification_opt): Don't call reset_type_access_control. * search.c (type_access_control): Remove. * semantics.c: Include "gt-cp-semantics.h". (deferred_type_access_control): Remove. (deferred_access_stack): New variable. (deferred_access_free_list): Likewise. (push_deferring_access_checks): New function. (resume_deferring_access_checks): Likewise. (stop_deferring_access_checks): Likewise. (pop_deferring_access_checks): Likewise. (get_deferred_access_checks): Likewise. (pop_to_parent_deferring_access_checks): Likewise. (perform_deferred_access_checks): New function, adapted from cp_parser_perform_deferred_access_checks. (perform_or_defer_access_check): New function, adapted from cp_parser_defer_access_check. (current_type_lookups): Remove. (deferred_type_access_control): Likewise. (decl_type_access_control): Likewise. (save_type_access_control): Likewise. (reset_type_access_control): Likewise. (begin_function_definition): Adjust. (begin_class_definiton): Likewise. From-SVN: r61283
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 5e9b395..0895a76 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -979,41 +979,6 @@ friend_accessible_p (scope, decl, binfo)
return 0;
}
-/* Perform access control on TYPE_DECL or TEMPLATE_DECL VAL, which was
- looked up in TYPE. This is fairly complex, so here's the design:
-
- The lang_extdef nonterminal sets type_lookups to NULL_TREE before we
- start to process a top-level declaration.
- As we process the decl-specifier-seq for the declaration, any types we
- see that might need access control are passed to type_access_control,
- which defers checking by adding them to type_lookups.
- When we are done with the decl-specifier-seq, we record the lookups we've
- seen in the lookups field of the typed_declspecs nonterminal.
- When we process the first declarator, either in parse_decl or
- begin_function_definition, we call save_type_access_control,
- which stores the lookups from the decl-specifier-seq in
- current_type_lookups.
- As we finish with each declarator, we process everything in type_lookups
- via decl_type_access_control, which resets type_lookups to the value of
- current_type_lookups for subsequent declarators.
- When we enter a function, we set type_lookups to error_mark_node, so all
- lookups are processed immediately. */
-
-void
-type_access_control (type, val)
- tree type, val;
-{
- if (val == NULL_TREE
- || (TREE_CODE (val) != TEMPLATE_DECL && TREE_CODE (val) != TYPE_DECL)
- || ! DECL_CLASS_SCOPE_P (val))
- return;
-
- if (type_lookups == error_mark_node)
- enforce_access (type, val);
- else if (! accessible_p (type, val))
- type_lookups = tree_cons (type, val, type_lookups);
-}
-
/* DECL is a declaration from a base class of TYPE, which was the
class used to name DECL. Return nonzero if, in the current
context, DECL is accessible. If TYPE is actually a BINFO node,