summaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-09-06 15:32:46 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-09-06 15:32:46 +0000
commitb991151b284774c5fba4fc3148728c41a21c5004 (patch)
tree9b92eab19e44e973d5308a183a902bfbcd54fae5 /gcc/cp/search.c
parentec7f007c776c7112f8134a6a8cd94a3463cd37e3 (diff)
downloadgcc-b991151b284774c5fba4fc3148728c41a21c5004.tar.gz
name-lookup.h (lookup_field_1): Delete.
* name-lookup.h (lookup_field_1): Delete. (get_class_binding_direct, get_class_binding): Add type_or_fns arg. * name-lookup.c (lookup_field_1): make static (method_vec_binary_search, method_vec_linear_search): New. Broken out of ... (get_class_binding_direct): ... here. Add TYPE_OR_FNS argument. Do complete search of this level. (get_class_binding): Adjust. * decl.c (reshape_init_class): Call get_class_binding. * search.c (lookup_field_r): Move field searching into get_class_binding_direct. From-SVN: r251808
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 38be467b7c6..11e721fc056 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -974,23 +974,7 @@ lookup_field_r (tree binfo, void *data)
&& !BINFO_VIRTUAL_P (binfo))
return dfs_skip_bases;
- /* First, look for a function. There can't be a function and a data
- member with the same name, and if there's a function and a type
- with the same name, the type is hidden by the function. */
- if (!lfi->want_type)
- nval = get_class_binding (type, lfi->name);
-
- if (!nval)
- /* Look for a data member or type. */
- nval = lookup_field_1 (type, lfi->name, lfi->want_type);
- else if (TREE_CODE (nval) == OVERLOAD && OVL_USING_P (nval))
- {
- /* If we have both dependent and non-dependent using-declarations, return
- the dependent one rather than an incomplete list of functions. */
- tree dep_using = lookup_field_1 (type, lfi->name, lfi->want_type);
- if (dep_using && TREE_CODE (dep_using) == USING_DECL)
- nval = dep_using;
- }
+ nval = get_class_binding (type, lfi->name, lfi->want_type);
/* If we're looking up a type (as with an elaborated type specifier)
we ignore all non-types we find. */