https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96605
Bug ID: 96605
Summary: ICE on C++20 code
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dimitri.gorokhovik at free dot fr
Target Milestone: ---
The following code:
#include <tuple>
template <auto T> concept Expression_Term = true;
template <auto T> concept Array_Term = true;
template <Expression_Term ... > struct dictionary {};
template <Array_Term ... > struct tuple {};
template <auto Dict, auto Lhs, auto Rhs> struct flow_graph {};
template <template <Expression_Term, Array_Term, Array_Term> class node,
Expression_Term ... exps, Array_Term ... lhs, Array_Term ... rhs>
constexpr auto apply (flow_graph <dictionary <exps...> {},
tuple <lhs...> {},
tuple <rhs...> {}>)
{
return std::tuple <node <exps, lhs, rhs>...> {};
};
produces this ICE: [version: g++ (GCC) 11.0.0 20200812 (experimental)]
g++ -o test-1 -std=c++2a -fconcepts-ts test-1.i
test-1.i: In function ‘constexpr auto apply(flow_graph<dictionary<exps ...>{},
tuple<lhs ...>{}, tuple<rhs ...>{}>)’:
test-1.i:11511:42: internal compiler error: in tsubst, at cp/pt.c:15388
11511 | return std::tuple <node <exps, lhs, rhs>...> {};
| ^
0x688eab tsubst(tree_node*, tree_node*, int, tree_node*)
../../src/gcc/cp/pt.c:15388
0xa101d6 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
../../src/gcc/cp/pt.c:29159
0xa39d02 convert_template_argument
../../src/gcc/cp/pt.c:8428
0xa3ca43 coerce_template_parms
../../src/gcc/cp/pt.c:8932
0xa285a8 lookup_template_class_1
../../src/gcc/cp/pt.c:9710
0xa2a0fc lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
../../src/gcc/cp/pt.c:10140
0xa641ab finish_template_type(tree_node*, tree_node*, int)
../../src/gcc/cp/semantics.c:3446
0x9ddb51 cp_parser_template_id
../../src/gcc/cp/parser.c:16833
0x9ddd43 cp_parser_class_name
../../src/gcc/cp/parser.c:23811
0x9d9c65 cp_parser_qualifying_entity
../../src/gcc/cp/parser.c:6844
0x9d9c65 cp_parser_nested_name_specifier_opt
../../src/gcc/cp/parser.c:6526
0x9e2815 cp_parser_simple_type_specifier
../../src/gcc/cp/parser.c:18229
0x9c642d cp_parser_type_specifier
../../src/gcc/cp/parser.c:17887
0x9dc143 cp_parser_type_specifier_seq
../../src/gcc/cp/parser.c:22493
0x9d4e54 cp_parser_type_id_1
../../src/gcc/cp/parser.c:22310
0x9d78e3 cp_parser_template_type_arg
../../src/gcc/cp/parser.c:22401
0x9dc2bf cp_parser_template_argument
../../src/gcc/cp/parser.c:17283
0x9dc2bf cp_parser_template_argument_list
../../src/gcc/cp/parser.c:17194
0x9dc2bf cp_parser_enclosed_template_argument_list
../../src/gcc/cp/parser.c:29886
0x9dd620 cp_parser_template_id
../../src/gcc/cp/parser.c:16766
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.