Commit 2cc7f90b by Jason Merrill Committed by Jason Merrill

re PR c++/58597 (ICE with lambda in default argument of template function)

	PR c++/58597
	* lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
	current_function_decl.

From-SVN: r220192
parent 53c04ec9
2015-01-27 Jason Merrill <jason@redhat.com>
PR c++/58597
* lambda.c (maybe_add_lambda_conv_op): Check cfun rather than
current_function_decl.
PR c++/63889
* pt.c (finish_template_variable): Move from semantics.c.
Handle multiple template arg levels. Handle coercion here.
......
......@@ -854,7 +854,7 @@ prepare_op_call (tree fn, int nargs)
void
maybe_add_lambda_conv_op (tree type)
{
bool nested = (current_function_decl != NULL_TREE);
bool nested = (cfun != NULL);
bool nested_def = decl_function_context (TYPE_MAIN_DECL (type));
tree callop = lambda_function (type);
......
// PR c++/58597
// { dg-do compile { target c++11 } }
template<typename> struct A
{
template<typename T> A(T, int = []{ return 0; }()) {}
};
A<int> a = 0;
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