summaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorsimartin <simartin@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-16 08:51:42 +0000
committersimartin <simartin@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-16 08:51:42 +0000
commit3369eb761be13d67e0c1e331eb2e900de4efaf91 (patch)
treea7b346cda4d3b77e77b9aa9c9d5fdd0dbacf5afe /gcc/cp/cp-tree.h
parent76fdb388b3695ec2c9a484a372ddd246d985cc1d (diff)
downloadgcc-3369eb761be13d67e0c1e331eb2e900de4efaf91.tar.gz
2006-12-16 Simon Martin <simartin@users.sourceforge.net>
PR c++/29475 * cp-tree.h (struct deferred_access_check): New structure to represent a deferred access check. It replaces the previous representation as a tree. (get_deferred_access_checks): Return a vector of struct deferred_access_check instead of a tree list. (perform_access_checks): Take a vector of struct deferred_access_check instead of a tree list. * semantics.c (struct deferred_access): Store the deferred access checks as a vector of struct deferred_access_check instead of a tree list. (push_deferring_access_checks): Handle the change in struct deferred_access. (get_deferred_access_checks): Likewise. (pop_to_parent_deferring_access_checks): Likewise. (perform_or_defer_access_check): Likewise. (perform_access_checks): Take a vector of struct deferred_access_check instead of a tree list. * parser.c (struct tree_check): New structure to store various data associated with a CPP_NESTED_NAME_SPECIFIER or CPP_TEMPLATE_ID token. (struct cp_token): Changed the value field to be a union with a pointer to a struct tree_check for CPP_NESTED_NAME_SPECIFIER or CPP_TEMPLATE_ID tokens and a tree field for all other tokens. (eof_token): Adjusted due to the change in struct cp_token. (cp_lexer_get_preprocessor_token): Likewise. (cp_lexer_purge_token): Likewise. (cp_lexer_purge_tokens_after): Likewise. (cp_lexer_print_token): Likewise. (cp_parser_error): Likewise. (cp_parser_identifier): Likewise. (cp_parser_string_literal): Likewise. (cp_parser_primary_expression): Likewise. (cp_parser_unqualified_id): Likewise. (cp_parser_parenthesized_expression_list): Likewise. (cp_parser_storage_class_specifier_opt): Likewise. (cp_parser_function_specifier_opt): Likewise. (cp_parser_type_specifier): Likewise. (cp_parser_simple_type_specifier): Likewise. (cp_parser_initializer_list): Likewise. (cp_parser_member_specification_opt): Likewise. (cp_parser_attribute_list): Likewise. (cp_parser_objc_expression): Likewise. (cp_parser_objc_protocol_qualifiers): Likewise. (cp_parser_objc_selector): Likewise. (cp_parser_objc_declaration): Likewise. (cp_parser_objc_statement): Likewise. (cp_parser_omp_clause_name): Likewise. (cp_parser_omp_clause_default): Likewise. (cp_parser_omp_clause_schedule): Likewise. (cp_parser_omp_parallel): Likewise. (cp_parser_initial_pragma): Likewise. (pragma_lex): Likewise. (cp_parser_pre_parsed_nested_name_specifier): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. Use cp_token::u::tree_check_value to save the token's value, the associated deferred checks and its qualifying scope. (cp_parser_template_id): Likewise. (cp_parser_template_declaration_after_export): Adjusted the call to get_deferred_access_checks. (cp_parser_init_declarator): Take the access checks as a vector of struct deferred_access_check instead of a tree list. (cp_parser_single_declaration): Likewise. (cp_parser_perform_template_parameter_access_checks): Likewise. (cp_parser_simple_declaration): Adjusted the call to cp_parser_init_declarator. (cp_parser_explicit_specialization): Adjusted the call to cp_parser_single_declaration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119961 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 3f63b8fc8d9..3968f96c9aa 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4234,14 +4234,29 @@ extern tree copied_binfo (tree, tree);
extern tree original_binfo (tree, tree);
extern int shared_member_p (tree);
+
+/* The representation of a deferred access check. */
+
+typedef struct deferred_access_check GTY(())
+{
+ /* The base class in which the declaration is referenced. */
+ tree binfo;
+ /* The declaration whose access must be checked. */
+ tree decl;
+ /* The declaration that should be used in the error message. */
+ tree diag_decl;
+} deferred_access_check;
+DEF_VEC_O(deferred_access_check);
+DEF_VEC_ALLOC_O(deferred_access_check,gc);
+
/* in semantics.c */
extern void push_deferring_access_checks (deferring_kind);
extern void resume_deferring_access_checks (void);
extern void stop_deferring_access_checks (void);
extern void pop_deferring_access_checks (void);
-extern tree get_deferred_access_checks (void);
+extern VEC (deferred_access_check,gc)* get_deferred_access_checks (void);
extern void pop_to_parent_deferring_access_checks (void);
-extern void perform_access_checks (tree);
+extern void perform_access_checks (VEC (deferred_access_check,gc)*);
extern void perform_deferred_access_checks (void);
extern void perform_or_defer_access_check (tree, tree, tree);
extern int stmts_are_full_exprs_p (void);