summaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-09 17:19:12 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-09 17:19:12 +0000
commit2cbaacd915abd833c03e181f78b86dce4e761718 (patch)
treea2a0fcb5fb051aad447bef4b04723c2b47b8dd19 /gcc/cp/search.c
parent7eda0fb788effb42e109ffa89f2bfe7dff227cf4 (diff)
downloadgcc-2cbaacd915abd833c03e181f78b86dce4e761718.tar.gz
/cp
2011-11-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51047 * search.c (lookup_member): Change to take also a tsubst_flags_t parameter. (lookup_field, lookup_fnfields): Adjust calls. * typeck.c (lookup_destructor, finish_class_member_access_expr, build_ptrmemfunc_access_expr): Likewise. * class.c (handle_using_decl, maybe_note_name_used_in_class): Likewise. * pt.c (resolve_typename_type): Likewise. * semantics.c (lambda_function): Likewise. * parser.c (cp_parser_perform_range_for_lookup, cp_parser_lookup_name): Likewise. * friend.c (make_friend_class): Likewise. * name-lookup.c (pushdecl_maybe_friend_1, get_class_binding, do_class_using_decl, lookup_qualified_name): Likewise. * cp-tree.h (lookup_member): Adjust declaration. /testsuite 2011-11-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51047 * g++.dg/cpp0x/sfinae29.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181213 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 40af661e953..7d9551c28bf 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1155,7 +1155,8 @@ build_baselink (tree binfo, tree access_binfo, tree functions, tree optype)
If nothing can be found return NULL_TREE and do not issue an error. */
tree
-lookup_member (tree xbasetype, tree name, int protect, bool want_type)
+lookup_member (tree xbasetype, tree name, int protect, bool want_type,
+ tsubst_flags_t complain)
{
tree rval, rval_binfo = NULL_TREE;
tree type = NULL_TREE, basetype_path = NULL_TREE;
@@ -1250,9 +1251,12 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
if (errstr && protect)
{
- error (errstr, name, type);
- if (lfi.ambiguous)
- print_candidates (lfi.ambiguous);
+ if (complain & tf_error)
+ {
+ error (errstr, name, type);
+ if (lfi.ambiguous)
+ print_candidates (lfi.ambiguous);
+ }
rval = error_mark_node;
}
@@ -1269,7 +1273,8 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
tree
lookup_field (tree xbasetype, tree name, int protect, bool want_type)
{
- tree rval = lookup_member (xbasetype, name, protect, want_type);
+ tree rval = lookup_member (xbasetype, name, protect, want_type,
+ tf_warning_or_error);
/* Ignore functions, but propagate the ambiguity list. */
if (!error_operand_p (rval)
@@ -1285,7 +1290,8 @@ lookup_field (tree xbasetype, tree name, int protect, bool want_type)
tree
lookup_fnfields (tree xbasetype, tree name, int protect)
{
- tree rval = lookup_member (xbasetype, name, protect, /*want_type=*/false);
+ tree rval = lookup_member (xbasetype, name, protect, /*want_type=*/false,
+ tf_warning_or_error);
/* Ignore non-functions, but propagate the ambiguity list. */
if (!error_operand_p (rval)