aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2025-07-24 15:38:36 -0400
committerJason Merrill <jason@redhat.com>2025-07-24 15:38:36 -0400
commit257b640d256d3f84e7307f5fdb08d2208d84f4b8 (patch)
tree119cd188d8d531ff6db1b394dbdacdb5b950ecfc
parenteb59e58dcc4cdf36b8b2d4e1654fe4fa062b5bef (diff)
downloadgcc-257b640d256d3f84e7307f5fdb08d2208d84f4b8.zip
gcc-257b640d256d3f84e7307f5fdb08d2208d84f4b8.tar.gz
gcc-257b640d256d3f84e7307f5fdb08d2208d84f4b8.tar.bz2
c++: one more PR114632 tweak
Patrick points out that after the PR114632 fix we can also rever the change that moved cp_evaluated higher in tsubst_lambda_expr. gcc/cp/ChangeLog: * pt.cc (tsubst_lambda_expr): Revert r9-5971 change.
-rw-r--r--gcc/cp/pt.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 8e17533..fd23be1 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -20497,11 +20497,6 @@ tsubst_lambda_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
r = error_mark_node;
else
{
- /* The body of a lambda-expression is not a subexpression of the
- enclosing expression. Parms are to have DECL_CHAIN tsubsted,
- which would be skipped if cp_unevaluated_operand. */
- cp_evaluated ev;
-
/* Fix the type of 'this'.
For static and xobj member functions we use this to transport the
lambda's closure type. It appears that in the regular case the
@@ -20527,6 +20522,10 @@ tsubst_lambda_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
/* Let finish_function set this. */
DECL_DECLARED_CONSTEXPR_P (fn) = false;
+ /* The body of a lambda-expression is not a subexpression of the
+ enclosing expression. */
+ cp_evaluated ev;
+
bool nested = cfun;
if (nested)
push_function_context ();