diff options
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 603b69b4876..91a5c1a0b08 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -491,7 +491,10 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p, { type = build_reference_type (type); if (!dependent_type_p (type) && !real_lvalue_p (initializer)) - error ("cannot capture %qE by reference", initializer); + { + error ("cannot capture %qE by reference", initializer); + return error_mark_node; + } } else { |