From e7b67047c79d2ea6867ed15b6441960219d77f29 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 21 Feb 2014 16:50:52 -0500 Subject: [PATCH] re PR c++/60252 ([c++11] ICE with invalid variable-length array in lambda parameter) PR c++/60252 * lambda.c (maybe_resolve_dummy): Check lambda_function rather than current_binding_level. From-SVN: r208028 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/lambda.c | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8e4a2a0..dd926da 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2014-02-21 Jason Merrill + PR c++/60252 + * lambda.c (maybe_resolve_dummy): Check lambda_function rather + than current_binding_level. + PR c++/60186 * typeck2.c (massage_init_elt): Call fold_non_dependent_expr_sfinae. diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 7fe235b..277dec6 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -749,10 +749,8 @@ 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 ()) - /* 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) + && lambda_function (current_class_type) + && DERIVED_FROM_P (type, current_nonlambda_class_type ())) { /* In a lambda, need to go through 'this' capture. */ tree lam = CLASSTYPE_LAMBDA_EXPR (current_class_type); -- 2.7.4