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:
parent
9aee04a4c0
commit
4cbe585c99
3 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
9
gcc/testsuite/g++.dg/cpp1z/constexpr-lambda21.C
Normal file
9
gcc/testsuite/g++.dg/cpp1z/constexpr-lambda21.C
Normal 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>;
|
Loading…
Add table
Reference in a new issue