diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-10-18 17:21:36 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-10-18 17:21:36 +0000 |
commit | 18e4be8561b8aee3937528dd27635eaf761e57d0 (patch) | |
tree | 236c7f936b34023b8a9d3dac4bda50d439059160 /gcc/cp/class.c | |
parent | b499264121070eb0876ab645d34bea38493c1821 (diff) | |
download | gcc-18e4be8561b8aee3937528dd27635eaf761e57d0.zip gcc-18e4be8561b8aee3937528dd27635eaf761e57d0.tar.gz gcc-18e4be8561b8aee3937528dd27635eaf761e57d0.tar.bz2 |
cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call.
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.
From-SVN: r89232
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index b1eec83..a0a2ed4 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -436,7 +436,7 @@ convert_to_base (tree object, tree type, bool check_access) tree binfo; binfo = lookup_base (TREE_TYPE (object), type, - check_access ? ba_check : ba_ignore, + check_access ? ba_check : ba_unique, NULL); if (!binfo || binfo == error_mark_node) return error_mark_node; @@ -526,7 +526,7 @@ build_vtbl_ref_1 (tree instance, tree idx) if (fixed_type && !cdtorp) { tree binfo = lookup_base (fixed_type, basetype, - ba_ignore|ba_quiet, NULL); + ba_unique | ba_quiet, NULL); if (binfo) vtbl = unshare_expr (BINFO_VTABLE (binfo)); } @@ -4392,13 +4392,17 @@ warn_about_ambiguous_bases (tree t) tree binfo; tree base_binfo; + /* If there are no repeated bases, nothing can be ambiguous. */ + if (!CLASSTYPE_REPEATED_BASE_P (t)) + return; + /* Check direct bases. */ for (binfo = TYPE_BINFO (t), i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo); ++i) { basetype = BINFO_TYPE (base_binfo); - if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL)) + if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL)) warning ("direct base %qT inaccessible in %qT due to ambiguity", basetype, t); } @@ -4410,7 +4414,7 @@ warn_about_ambiguous_bases (tree t) { basetype = BINFO_TYPE (binfo); - if (!lookup_base (t, basetype, ba_ignore | ba_quiet, NULL)) + if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL)) warning ("virtual base %qT inaccessible in %qT due to ambiguity", basetype, t); } |