aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-09-13 10:37:49 -0700
committerIan Lance Taylor <iant@golang.org>2021-09-13 10:37:49 -0700
commite252b51ccde010cbd2a146485d8045103cd99533 (patch)
treee060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/cp/lambda.c
parentf10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff)
parent104c05c5284b7822d770ee51a7d91946c7e56d50 (diff)
downloadgcc-e252b51ccde010cbd2a146485d8045103cd99533.zip
gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz
gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r--gcc/cp/lambda.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index 421685c..2e9d38b 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -41,6 +41,7 @@ build_lambda_expr (void)
LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (lambda) = CPLD_NONE;
LAMBDA_EXPR_CAPTURE_LIST (lambda) = NULL_TREE;
LAMBDA_EXPR_THIS_CAPTURE (lambda) = NULL_TREE;
+ LAMBDA_EXPR_REGEN_INFO (lambda) = NULL_TREE;
LAMBDA_EXPR_PENDING_PROXIES (lambda) = NULL;
LAMBDA_EXPR_MUTABLE_P (lambda) = false;
return lambda;
@@ -159,24 +160,6 @@ begin_lambda_type (tree lambda)
return type;
}
-/* Returns the type to use for the return type of the operator() of a
- closure class. */
-
-tree
-lambda_return_type (tree expr)
-{
- if (expr == NULL_TREE)
- return void_type_node;
- if (type_unknown_p (expr)
- || BRACE_ENCLOSED_INITIALIZER_P (expr))
- {
- cxx_incomplete_type_error (expr, TREE_TYPE (expr));
- return error_mark_node;
- }
- gcc_checking_assert (!type_dependent_expression_p (expr));
- return cv_unqualified (type_decays_to (unlowered_expr_type (expr)));
-}
-
/* Given a LAMBDA_EXPR or closure type LAMBDA, return the op() of the
closure type. */
@@ -606,8 +589,11 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p,
parameter pack in this context. We will want as many fields as we
have elements in the expansion of the initializer, so use its packs
instead. */
- PACK_EXPANSION_PARAMETER_PACKS (type)
- = uses_parameter_packs (initializer);
+ {
+ PACK_EXPANSION_PARAMETER_PACKS (type)
+ = uses_parameter_packs (initializer);
+ PACK_EXPANSION_AUTO_P (type) = true;
+ }
}
/* Make member variable. */
@@ -1352,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;
}