diff options
author | Jason Merrill <jason@redhat.com> | 2021-04-16 13:52:02 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-06-07 23:55:04 -0400 |
commit | 1a98f830332e5a623278aaeea39c2a88177b2a9a (patch) | |
tree | 394b8795839aa54eec537dd66513b208bea6d90f /gcc/cp/name-lookup.c | |
parent | f07edb5d7f3e77218ec846a9382f7c1d23e67b71 (diff) | |
download | gcc-1a98f830332e5a623278aaeea39c2a88177b2a9a.zip gcc-1a98f830332e5a623278aaeea39c2a88177b2a9a.tar.gz gcc-1a98f830332e5a623278aaeea39c2a88177b2a9a.tar.bz2 |
c++: preserve BASELINK from lookup [PR91706]
In the earlier patch for PR91706 I fixed the BASELINK built by
baselink_for_fns, but since we already had one from lookup, we should keep
that one around instead of stripping it. The removed hunk in
get_class_binding was a wierdly large amount of code to decide whether to
pull out BASELINK_FUNCTIONS.
gcc/cp/ChangeLog:
PR c++/91706
* name-lookup.c (get_class_binding): Keep a BASELINK.
(set_inherited_value_binding_p): Adjust.
* lambda.c (is_lambda_ignored_entity): Adjust.
* pt.c (lookup_template_function): Copy a BASELINK before
modifying it.
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r-- | gcc/cp/name-lookup.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 241ad2b..1be5f3d 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -5236,7 +5236,7 @@ set_inherited_value_binding_p (cxx_binding *binding, tree decl, { tree context; - if (TREE_CODE (decl) == OVERLOAD) + if (is_overloaded_fn (decl)) context = ovl_scope (decl); else { @@ -5338,28 +5338,6 @@ get_class_binding (tree name, cp_binding_level *scope) /*protect=*/2, /*want_type=*/false, tf_warning_or_error); - if (value_binding - && (TREE_CODE (value_binding) == TYPE_DECL - || DECL_CLASS_TEMPLATE_P (value_binding) - || (TREE_CODE (value_binding) == TREE_LIST - && TREE_TYPE (value_binding) == error_mark_node - && (TREE_CODE (TREE_VALUE (value_binding)) - == TYPE_DECL)))) - /* We found a type binding, even when looking for a non-type - binding. This means that we already processed this binding - above. */ - ; - else if (value_binding) - { - if (TREE_CODE (value_binding) == TREE_LIST - && TREE_TYPE (value_binding) == error_mark_node) - /* NAME is ambiguous. */ - ; - else if (BASELINK_P (value_binding)) - /* NAME is some overloaded functions. */ - value_binding = BASELINK_FUNCTIONS (value_binding); - } - /* If we found either a type binding or a value binding, create a new binding object. */ if (type_binding || value_binding) |