aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-04-16 13:52:02 -0400
committerJason Merrill <jason@redhat.com>2021-06-07 23:55:04 -0400
commit1a98f830332e5a623278aaeea39c2a88177b2a9a (patch)
tree394b8795839aa54eec537dd66513b208bea6d90f /gcc/cp/lambda.c
parentf07edb5d7f3e77218ec846a9382f7c1d23e67b71 (diff)
downloadgcc-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/lambda.c')
-rw-r--r--gcc/cp/lambda.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index 4a1e090..2e9d38b 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -1338,9 +1338,9 @@ is_lambda_ignored_entity (tree val)
/* None of the lookups that use qualify_lookup want the op() from the
lambda; they want the one from the enclosing class. */
- val = OVL_FIRST (val);
- if (LAMBDA_FUNCTION_P (val))
- return true;
+ if (tree fns = maybe_get_fns (val))
+ if (LAMBDA_FUNCTION_P (OVL_FIRST (fns)))
+ return true;
return false;
}