diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-18 17:21:36 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-18 17:21:36 +0000 |
commit | ada40935ef7cd6d2300ac09d22584a87e0dcd93c (patch) | |
tree | 236c7f936b34023b8a9d3dac4bda50d439059160 /gcc/cp/call.c | |
parent | a1f487759c3044b9471a858df8127c6136fd22a1 (diff) | |
download | gcc-ada40935ef7cd6d2300ac09d22584a87e0dcd93c.tar.gz |
cp:
* cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call.
(ACCESSIBLY_UNIQUELY_DERIVED_P): Remove.
(PUBLICLY_UNIQUELY_DERIVED_P): Adjust lookup_base call.
(enum base_access): Reorganize.
(accessible_base_p, accessible_p): Add consider_local_p parameter.
* call.c (standard_conversion): Update comment about
DERIVED_FROM_P.
(enforce_access): Adjust accessible_p call.
(build_over_call): Adjust accessible_base_p call.
* class.c (convert_to_base): Adjust lookup_base call.
(build_vtbl_ref_1): Likewise.
(warn_about_ambiguous_bases): Likewise. Add early exit.
* cvt.c (convert_to_pointer_force) Adjust lookup_base call.
* search.c (accessible_base_p): Add consider_local_p parameter.
(lookup_base): Pass consider_local_p to accessible_base_p call.
(friend_accessible_p): Check whether scope is a class member.
Remove unnecessary class template check.
(accessible_p): Add consider_local_p parameter. Use it.
(adjust_result_of_qualified_name_lookup): Adjust lookup_base call.
* tree.c (maybe_dummy_object): Likewise.
* typeck.c (comp_except_type): Use PUBLICLY_UNIQUELY_DERIVED_P.
(build_class_member_access_expr): Adjust lookup_base call.
* typeck2.c (binfo_or_else): Likewise.
* rtti.c (build_dynamic_cast_1): Access can consider friendship
and current scope.
testsuite:
* g++.dg/eh/shadow1.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89232 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 7d4e9634e4c..f15fd2ccb4a 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -711,9 +711,9 @@ standard_conversion (tree to, tree from, tree expr) _class.derived_) of D. If B is an inaccessible (clause _class.access_) or ambiguous (_class.member.lookup_) base class of D, a program - that necessitates this conversion is ill-formed. */ - /* Therefore, we use DERIVED_FROM_P, and not - ACCESSIBLY_UNIQUELY_DERIVED_FROM_P, in this test. */ + that necessitates this conversion is ill-formed. + Therefore, we use DERIVED_FROM_P, and do not check + access or uniqueness. */ && DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from))) { from = @@ -4051,7 +4051,7 @@ enforce_access (tree basetype_path, tree decl) { gcc_assert (TREE_CODE (basetype_path) == TREE_BINFO); - if (!accessible_p (basetype_path, decl)) + if (!accessible_p (basetype_path, decl, true)) { if (TREE_PRIVATE (decl)) cp_error_at ("%q+#D is private", decl); @@ -4670,7 +4670,7 @@ build_over_call (struct z_candidate *cand, int flags) 1); /* Check that the base class is accessible. */ if (!accessible_base_p (TREE_TYPE (argtype), - BINFO_TYPE (cand->conversion_path))) + BINFO_TYPE (cand->conversion_path), true)) error ("%qT is not an accessible base of %qT", BINFO_TYPE (cand->conversion_path), TREE_TYPE (argtype)); @@ -4678,7 +4678,7 @@ build_over_call (struct z_candidate *cand, int flags) will be to the derived class, not the base declaring fn. We must convert from derived to base. */ base_binfo = lookup_base (TREE_TYPE (TREE_TYPE (converted_arg)), - TREE_TYPE (parmtype), ba_ignore, NULL); + TREE_TYPE (parmtype), ba_unique, NULL); converted_arg = build_base_path (PLUS_EXPR, converted_arg, base_binfo, 1); |