https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96676
Bug ID: 96676
Summary: Segmentation fault on parsing simple variadic template
function call
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ivan.leonov.d at yandex dot ru
Target Milestone: ---
Sample code:
template < typename T, typename... TYPES >
struct A {
template < TYPES... types >
void Get() { }
};
void f() {}
int main() {
A<int, decltype(&f)> a;
a.Get<&f>();
}
Error and Backtrace:
prog.cc: In function 'int main()':
prog.cc:13:15: internal compiler error: Segmentation fault
13 | a.Get<&f>();
| ^
0xc026af crash_signal
../../source/gcc/toplev.c:327
0x73a995 tsubst_pack_expansion(tree_node*, tree_node*, int, tree_node*)
../../source/gcc/cp/pt.c:12871
0x7356d1 coerce_template_parameter_pack
../../source/gcc/cp/pt.c:8538
0x7356d1 coerce_template_parms
../../source/gcc/cp/pt.c:8830
0x747bc8 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
../../source/gcc/cp/pt.c:21078
0x619282 add_template_candidate_real
../../source/gcc/cp/call.c:3417
0x6199bc add_template_candidate
../../source/gcc/cp/call.c:3502
0x6199bc add_candidates
../../source/gcc/cp/call.c:5883
0x61a9cc add_candidates
../../source/gcc/cp/call.c:5798
0x61a9cc build_new_method_call_1
../../source/gcc/cp/call.c:10271
0x61b6ff build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
../../source/gcc/cp/call.c:10478
0x6fcdd7 cp_parser_postfix_expression
../../source/gcc/cp/parser.c:7513
0x6dfa9a cp_parser_binary_expression
../../source/gcc/cp/parser.c:9641
0x6e13de cp_parser_assignment_expression
../../source/gcc/cp/parser.c:9946
0x6e16e2 cp_parser_expression
../../source/gcc/cp/parser.c:10114
0x6e41b8 cp_parser_expression_statement
../../source/gcc/cp/parser.c:11774
0x6eef10 cp_parser_statement
../../source/gcc/cp/parser.c:11570
0x6f076d cp_parser_statement_seq_opt
../../source/gcc/cp/parser.c:11921
0x6f0820 cp_parser_compound_statement
../../source/gcc/cp/parser.c:11871
0x7078da cp_parser_function_body
../../source/gcc/cp/parser.c:23170