aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-02-21 09:56:31 -0500
committerJason Merrill <jason@gcc.gnu.org>2014-02-21 09:56:31 -0500
commit1c195d2a8fcc6161198e2be68293cd824051b063 (patch)
treed699b4b6ed6349c862784364a90e6f787d63ad9c /gcc/cp/lambda.c
parente9cd655135c621b4df78551676eefe6ebd3e6390 (diff)
downloadgcc-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.c5
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);