https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61351
Bug ID: 61351 Summary: ICE on valid when deducing template arguments with nested expansions of the same pack Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: richard-gccbugzilla at metafoo dot co.uk Testcase: template<class ...T> struct X {}; template<class ...T> void foo(X<T, T...>... a); void test() { foo(X<int, int, double>(), X<double, int, double>()); } Result in: <stdin>: In substitution of ‘template<class ... T> void foo(X<T, T ...>...) [with T = <missing>]’: <stdin>:10:56: required from here <stdin>:10:56: internal compiler error: tree check: expected class ‘expression’, have ‘type’ (integer_type) in tree_operand_check, at tree.h:3146 0xd66c27 tree_class_check_failed(tree_node const*, tree_code_class, char const*, int, char const*) ../../src/gcc/tree.c:9243 0x4f4bdb expr_check ../../src/gcc/tree.h:2882 0x4f4bdb tree_operand_check ../../src/gcc/tree.h:3146 0x5dd069 tree_operand_check ../../src/gcc/tree.h:2713 0x5dd069 unify_pack_expansion ../../src/gcc/cp/pt.c:17119 0x5d9c2c unify ../../src/gcc/cp/pt.c:17906 0x5d7d63 unify ../../src/gcc/cp/pt.c:17802 0x5d89b6 unify ../../src/gcc/cp/pt.c:17898 0x4f4fe9 try_class_unification ../../src/gcc/cp/pt.c:16913 0x5d7ea9 unify ../../src/gcc/cp/pt.c:17934 0x5db637 unify_one_argument ../../src/gcc/cp/pt.c:16338 0x5dc680 unify_pack_expansion ../../src/gcc/cp/pt.c:17151 0x5ddf6a type_unification_real ../../src/gcc/cp/pt.c:16430 0x5e679a fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool) ../../src/gcc/cp/pt.c:15848 0x552801 add_template_candidate_real ../../src/gcc/cp/call.c:2974 0x54e4dc add_template_candidate ../../src/gcc/cp/call.c:3071 0x54e4dc add_candidates ../../src/gcc/cp/call.c:5136 0x554909 perform_overload_resolution ../../src/gcc/cp/call.c:3871 0x55792a build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, int) ../../src/gcc/cp/call.c:3948 0x6d6fc4 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ../../src/gcc/cp/semantics.c:2355