Commit 4473482d by Paolo Carlini Committed by Paolo Carlini

re PR c++/72800 (ICE on invalid C++14 code with initialized lambda capture: tree…

re PR c++/72800 (ICE on invalid C++14 code with initialized lambda capture: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in add_capture, at cp/lambda.c:505)

/cp
2016-08-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/72800
	* lambda.c (add_capture): Check lambda_capture_field_type return
	value for error_mark_node.

/testsuite
2016-08-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/72800
	* g++.dg/cpp1y/lambda-ice1.C: New.

From-SVN: r239148
parent 08156df5
2016-08-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/72800
* lambda.c (add_capture): Check lambda_capture_field_type return
value for error_mark_node.
2016-08-04 Patrick Palka <ppalka@gcc.gnu.org> 2016-08-04 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/72759 PR c++/72759
......
...@@ -492,6 +492,8 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p, ...@@ -492,6 +492,8 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p,
else else
{ {
type = lambda_capture_field_type (initializer, explicit_init_p); type = lambda_capture_field_type (initializer, explicit_init_p);
if (type == error_mark_node)
return error_mark_node;
if (by_reference_p) if (by_reference_p)
{ {
type = build_reference_type (type); type = build_reference_type (type);
......
2016-08-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/72800
* g++.dg/cpp1y/lambda-ice1.C: New.
2016-08-04 Patrick Palka <ppalka@gcc.gnu.org> 2016-08-04 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/72759 PR c++/72759
......
// PR c++/72800
// { dg-do compile { target c++14 } }
void foo ()
{
[n {}] {}; // { dg-error "one element|deducing" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment