summaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-05 10:14:37 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-05 10:14:37 +0000
commitae260dcca75e4533feb88008e0b6955f9285a94e (patch)
tree2f95f089c2fa4d79dab5770ad9a8b5fa4956d54b /gcc/cp/search.c
parentfd28e216af180749a1b733a72218754ecc1b25d6 (diff)
downloadgcc-ae260dcca75e4533feb88008e0b6955f9285a94e.tar.gz
/cp
2012-09-05 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54191 * search.c (lookup_base): Add tsubst_flags_t parameter. (adjust_result_of_qualified_name_lookup, check_final_overrider): Adjust. * name-lookup.c (do_class_using_decl): Adjust. * typeck2.c (binfo_or_else, build_scoped_ref, build_m_component_ref): Likewise. * cvt.c (cp_convert_to_pointer, convert_to_pointer_force, build_up_reference): Likewise. * rtti.c (build_dynamic_cast_1): Likewise. * tree.c (maybe_dummy_object): Likewise. * call.c (build_conditional_expr_1, build_over_call): Likewise. * cp-tree.h (UNIQUELY_DERIVED_FROM_P, PUBLICLY_UNIQUELY_DERIVED_P): Remove. (enum base_access_flags, ba_quiet): Remove. (uniquely_derived_from_p, publicly_uniquely_derived_p): Declare. * except.c (can_convert_eh): Adjust. * decl.c (grokdeclarator): Likewise. * typeck.c (comp_except_types, build_class_member_access_expr, finish_class_member_access_expr, get_member_function_from_ptrfunc, build_static_cast_1, get_delta_difference_1): Likewise. * class.c (build_base_path, convert_to_base, build_vtbl_ref_1, warn_about_ambiguous_bases): Likewise. (uniquely_derived_from_p, publicly_uniquely_derived_p): Define. /testsuite 2012-09-05 Paolo Carlini <paolo.carlini@oracle.com> PR c++/54191 * g++.dg/cpp0x/sfinae39.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190969 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c42
1 files changed, 18 insertions, 24 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index dc802e4e9a2..7d358ef3a47 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -179,13 +179,13 @@ accessible_base_p (tree t, tree base, bool consider_local_p)
non-NULL, fill with information about what kind of base we
discovered.
- If the base is inaccessible, or ambiguous, and the ba_quiet bit is
- not set in ACCESS, then an error is issued and error_mark_node is
- returned. If the ba_quiet bit is set, then no error is issued and
- NULL_TREE is returned. */
+ If the base is inaccessible, or ambiguous, then error_mark_node is
+ returned. If the tf_error bit of COMPLAIN is not set, no error
+ is issued. */
tree
-lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
+lookup_base (tree t, tree base, base_access access,
+ base_kind *kind_ptr, tsubst_flags_t complain)
{
tree binfo;
tree t_binfo;
@@ -251,11 +251,9 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
break;
case bk_ambig:
- if (!(access & ba_quiet))
- {
- error ("%qT is an ambiguous base of %qT", base, t);
- binfo = error_mark_node;
- }
+ if (complain & tf_error)
+ error ("%qT is an ambiguous base of %qT", base, t);
+ binfo = error_mark_node;
break;
default:
@@ -269,13 +267,9 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
&& COMPLETE_TYPE_P (base)
&& !accessible_base_p (t, base, !(access & ba_ignore_scope)))
{
- if (!(access & ba_quiet))
- {
- error ("%qT is an inaccessible base of %qT", base, t);
- binfo = error_mark_node;
- }
- else
- binfo = NULL_TREE;
+ if (complain & tf_error)
+ error ("%qT is an inaccessible base of %qT", base, t);
+ binfo = error_mark_node;
bk = bk_inaccessible;
}
break;
@@ -1537,14 +1531,13 @@ adjust_result_of_qualified_name_lookup (tree decl,
or ambiguity -- in either case, the choice of a static member
function might make the usage valid. */
base = lookup_base (context_class, qualifying_scope,
- ba_unique | ba_quiet, NULL);
- if (base)
+ ba_unique, NULL, tf_none);
+ if (base && base != error_mark_node)
{
BASELINK_ACCESS_BINFO (decl) = base;
BASELINK_BINFO (decl)
= lookup_base (base, BINFO_TYPE (BASELINK_BINFO (decl)),
- ba_unique | ba_quiet,
- NULL);
+ ba_unique, NULL, tf_none);
}
}
@@ -1875,12 +1868,13 @@ check_final_overrider (tree overrider, tree basefn)
/* Strictly speaking, the standard requires the return type to be
complete even if it only differs in cv-quals, but that seems
like a bug in the wording. */
- if (!same_type_ignoring_top_level_qualifiers_p (base_return, over_return))
+ if (!same_type_ignoring_top_level_qualifiers_p (base_return,
+ over_return))
{
tree binfo = lookup_base (over_return, base_return,
- ba_check | ba_quiet, NULL);
+ ba_check, NULL, tf_none);
- if (!binfo)
+ if (!binfo || binfo == error_mark_node)
fail = 1;
}
}