diff options
author | Jason Merrill <jason@redhat.com> | 2014-02-21 09:56:31 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-02-21 09:56:31 -0500 |
commit | 1c195d2a8fcc6161198e2be68293cd824051b063 (patch) | |
tree | d699b4b6ed6349c862784364a90e6f787d63ad9c /gcc/cp/lambda.c | |
parent | e9cd655135c621b4df78551676eefe6ebd3e6390 (diff) | |
download | gcc-1c195d2a8fcc6161198e2be68293cd824051b063.zip gcc-1c195d2a8fcc6161198e2be68293cd824051b063.tar.gz gcc-1c195d2a8fcc6161198e2be68293cd824051b063.tar.bz2 |
re PR c++/60252 ([c++11] ICE with invalid variable-length array in lambda parameter)
PR c++/60252
* lambda.c (maybe_resolve_dummy): Don't try to capture this
in declaration context.
From-SVN: r207999
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); |