https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120742
Bug ID: 120742
Summary: ICE: tree check: expected tree_vec, have
type_pack_expansion in coerce_template_parameter_pack,
at cp/pt.cc:9042
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: ice-checking, ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rush102333 at gmail dot com
Target Milestone: ---
Simplified test:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
template <class...T> struct A
{
template <template <T> class... TP, class U> struct B;
template <, typename U> class B<TP, U>{ };
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Stack Dump:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:4:13: error: expected identifier before ',' token [-Wtemplate-body]
4 | template <, typename U> class B<TP, U>{ };
| ^
<source>:4:35: error: 'TP' was not declared in this scope; did you mean 'T'?
[-Wtemplate-body]
4 | template <, typename U> class B<TP, U>{ };
| ^~
| T
<source>:4:40: internal compiler error: tree check: expected tree_vec, have
type_pack_expansion in coerce_template_parameter_pack, at cp/pt.cc:9042
4 | template <, typename U> class B<TP, U>{ };
| ^
0x2839bc5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
???:0
0x285b356 internal_error(char const*, ...)
???:0
0x9eb228 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
???:0
0xd3b3ff lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int)
???:0
0xd88e1c finish_template_type(tree_node*, tree_node*, int)
???:0
0xd07843 c_parse_file()
???:0
0xe6f329 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See https://godbolt.org/z/EMcf6P1cE