summaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-24 15:40:06 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-24 15:40:06 +0000
commite4f430b5f97fabfc71b51faa4d28914bf1292edb (patch)
treed50a764e01dcd1dc880e14a21c3e985f121b8667 /gcc/cp/semantics.c
parentcafefe79cb417067ae3cb21995053657c435eec2 (diff)
downloadgcc-e4f430b5f97fabfc71b51faa4d28914bf1292edb.tar.gz
* call.c (enforce_access): Assert we get a binfo.
(build_op_delete_call): Pass a binfo to perform_or_defer_access_check. * class.c (alter_access): Likewise. * decl.c (make_typename_type): Likewise. (make_unbound_class_template): Likewise. * lex.c (do_identifier): Likewise. * method.c (hack_identifier): Likewise. * parser.c (cp_parser_lookup_name): Likewise. * search.c (lookup_member): Likewise. Move IDENTIFIER_CLASS_VALUE test. * semantics.c (finish_non_static_data_member): Likewise. (perform_or_defer_access_check): Expect a binfo. * typeck.c (comptypes): Expect types. * mangle.c (find_substitution): Don't pass a non-type to same_type_p * friend.c (make_friend_class): Likewise. * pt.c (check_default_tmpl_args): Likewise. (lookup_template_class): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68424 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index bb55b75af88..3272284d9c7 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -262,16 +262,18 @@ void perform_deferred_access_checks (void)
}
/* Defer checking the accessibility of DECL, when looked up in
- CLASS_TYPE. */
+ BINFO. */
-void perform_or_defer_access_check (tree class_type, tree decl)
+void perform_or_defer_access_check (tree binfo, tree decl)
{
tree check;
+ my_friendly_assert (TREE_CODE (binfo) == TREE_VEC, 20030623);
+
/* If we are not supposed to defer access checks, just check now. */
if (deferred_access_stack->deferring_access_checks_kind == dk_no_deferred)
{
- enforce_access (class_type, decl);
+ enforce_access (binfo, decl);
return;
}
/* Exit if we are in a context that no access checking is performed. */
@@ -282,13 +284,11 @@ void perform_or_defer_access_check (tree class_type, tree decl)
for (check = deferred_access_stack->deferred_access_checks;
check;
check = TREE_CHAIN (check))
- if (TREE_VALUE (check) == decl
- && TYPE_P (TREE_PURPOSE (check))
- && same_type_p (TREE_PURPOSE (check), class_type))
+ if (TREE_VALUE (check) == decl && TREE_PURPOSE (check) == binfo)
return;
/* If not, record the check. */
deferred_access_stack->deferred_access_checks
- = tree_cons (class_type, decl,
+ = tree_cons (binfo, decl,
deferred_access_stack->deferred_access_checks);
}
@@ -1255,7 +1255,7 @@ finish_non_static_data_member (tree decl, tree qualifying_scope)
return error_mark_node;
}
- perform_or_defer_access_check (access_type, decl);
+ perform_or_defer_access_check (TYPE_BINFO (access_type), decl);
/* If the data member was named `C::M', convert `*this' to `C'
first. */