PR c++/85228 - ICE with lambda in enumerator.

* pt.c (bt_instantiate_type_proc): Don't assume
	CLASSTYPE_TEMPLATE_INFO is non-null.

From-SVN: r259130
This commit is contained in:
Jason Merrill 2018-04-05 10:48:40 -04:00 committed by Jason Merrill
parent 9aee04a4c0
commit 4cbe585c99
3 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2018-04-05 Jason Merrill <jason@redhat.com>
PR c++/85228 - ICE with lambda in enumerator in template.
* pt.c (bt_instantiate_type_proc): Don't assume
CLASSTYPE_TEMPLATE_INFO is non-null.
2018-04-05 Ville Voutilainen <ville.voutilainen@gmail.com>
Implement P0969

View file

@ -22841,6 +22841,7 @@ bt_instantiate_type_proc (binding_entry entry, void *data)
tree storage = *(tree *) data;
if (MAYBE_CLASS_TYPE_P (entry->type)
&& CLASSTYPE_TEMPLATE_INFO (entry->type)
&& !uses_template_parms (CLASSTYPE_TI_ARGS (entry->type)))
do_type_instantiation (TYPE_MAIN_DECL (entry->type), storage, 0);
}

View file

@ -0,0 +1,9 @@
// PR c++/85228
// { dg-additional-options -std=c++17 }
template<int> struct A
{
enum E { e = []{ return 0; }() };
};
template class A<0>;