aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
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 0e02375fa1b..14ff6c2ae43 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -529,7 +529,10 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p,
else if (id != this_identifier && by_reference_p)
{
if (!lvalue_p (initializer))
- error ("cannot capture %qE by reference", initializer);
+ {
+ error ("cannot capture %qE by reference", initializer);
+ return error_mark_node;
+ }
}
else
{