diff options
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 4747a72..9ba3df1 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -590,7 +590,11 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p, /* Add it to the appropriate closure class if we've started it. */ if (current_class_type && current_class_type == LAMBDA_EXPR_CLOSURE (lambda)) - finish_member_declaration (member); + { + if (COMPLETE_TYPE_P (current_class_type)) + internal_error ("trying to capture %qD after closure is complete", id); + finish_member_declaration (member); + } tree listmem = member; if (variadic) |