Commit 7624ca36 by Ville Voutilainen Committed by Ville Voutilainen

re PR c++/58566 ([c++11] ICE with invalid expression in lambda body)

PR c++/58566

/cp
2015-10-12  Ville Voutilainen  <ville.voutilainen@gmail.com>

	PR c++/58566
	* lambda.c (lambda_return_type): Return error_mark_node
	instead of void_type_node for the error cases.

/testsuite
2015-10-12  Ville Voutilainen  <ville.voutilainen@gmail.com>

	PR c++/58566
	* g++.dg/cpp0x/lambda/lambda-58566.C: New.

From-SVN: r228706
parent 15f128a7
2015-10-12 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/58566
* lambda.c (lambda_return_type): Return error_mark_node
instead of void_type_node for the error cases.
2015-10-08 Jason Merrill <jason@redhat.com>
* cp-tree.h (SIMPLE_TARGET_EXPR_P): New.
......
......@@ -175,7 +175,7 @@ lambda_return_type (tree expr)
|| BRACE_ENCLOSED_INITIALIZER_P (expr))
{
cxx_incomplete_type_error (expr, TREE_TYPE (expr));
return void_type_node;
return error_mark_node;
}
gcc_checking_assert (!type_dependent_expression_p (expr));
return cv_unqualified (type_decays_to (unlowered_expr_type (expr)));
......
2015-10-12 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/58566
* g++.dg/cpp0x/lambda/lambda-58566.C: New.
2015-10-10 Jan Hubicka <hubicka@ucw.cz>
* gfortran.dg/lto/bind_c-2_0.f90: New testcase.
......
// PR c++/58566
// { dg-do compile { target c++11 } }
struct A
{
int foo()
{
[this]{ return foo; }; // { dg-error "invalid use of member function|cannot convert" }
}
};
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