commit 7c51c3a6ef0b137fc124ba65f686a607370f2c3a
Author: Jason Merrill <jason@redhat.com>
Date: Thu Apr 5 10:26:20 2018 -0400
PR c++/85228 - ICE with lambda in enumerator.
* pt.c (bt_instantiate_type_proc): Don't assume
CLASSTYPE_TEMPLATE_INFO is non-null.
@@ -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);
}
new file mode 100644
@@ -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>;