aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r--gcc/cp/lambda.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index f128ed8..d621bec 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -1046,6 +1046,12 @@ maybe_add_lambda_conv_op (tree type)
return;
}
+ /* Non-generic non-capturing lambdas only have a conversion function to
+ pointer to function when the trailing requires-clause's constraints are
+ satisfied. */
+ if (!generic_lambda_p && !constraints_satisfied_p (callop))
+ return;
+
/* Non-template conversion operators are defined directly with build_call_a
and using DIRECT_ARGVEC for arguments (including 'this'). Templates are
deferred and the CALL is built in-place. In the case of a deduced return