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
This commit is contained in:
parent
53c04ec92a
commit
2cc7f90b6e
|
@ -1,5 +1,9 @@
|
|||
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);
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// 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;
|
Loading…
Reference in New Issue