diff options
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index ad993e9d..7fe235b 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -749,7 +749,10 @@ maybe_resolve_dummy (tree object) if (type != current_class_type && current_class_type && LAMBDA_TYPE_P (current_class_type) - && DERIVED_FROM_P (type, current_nonlambda_class_type ())) + && DERIVED_FROM_P (type, current_nonlambda_class_type ()) + /* If we get here while parsing the parameter list of a lambda, it + will fail, so don't even try (c++/60252). */ + && current_binding_level->kind != sk_function_parms) { /* In a lambda, need to go through 'this' capture. */ tree lam = CLASSTYPE_LAMBDA_EXPR (current_class_type); |