/cp
2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71570
* lambda.c (add_capture): Early return if we cannot capture by
reference.
/testsuite
2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71570
* g++.dg/cpp0x/lambda/lambda-ice17.C: New.
From-SVN: r250591
+2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/71570
+ * lambda.c (add_capture): Early return if we cannot capture by
+ reference.
+
2017-07-26 Jason Merrill <jason@redhat.com>
P0702R1 - List deduction of vector.
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
{
+2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/71570
+ * g++.dg/cpp0x/lambda/lambda-ice17.C: New.
+
2017-07-26 H.J. Lu <hongjiu.lu@intel.com>
PR target/81563
--- /dev/null
+// PR c++/71570
+// { dg-do compile { target c++11 } }
+
+void foo (int);
+
+void foo (void)
+{
+ [&foo] // { dg-error "cannot capture" }
+ {
+ foo (0);
+ };
+}