https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67151
Bug ID: 67151 Summary: internal compiler error: in tsubst, at cp/pt.c:12126 Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: nickolay.merkin at gmail dot com Target Milestone: --- http://ideone.com/4t9nUW C++14 Source file (just two lines!) template<int N> const auto ice = true ? 0 : ice<(N>0 ? N-1 : 0)>; const auto crash = ice<1>; Output: prog.cpp: In instantiation of 'const auto ice<1>': prog.cpp:2:20: required from here prog.cpp:1:28: internal compiler error: in tsubst, at cp/pt.c:12126 template<int N> const auto ice = true ? 0 : ice<(N>0 ? N-1 : 0)>; ^ 0x821bd70 tsubst(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:12126 0x822793a tsubst_decl ../../src/gcc/cp/pt.c:11441 0x821b2be tsubst(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:11934 0x8225b04 tsubst_copy ../../src/gcc/cp/pt.c:13081 0x8217f03 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:15705 0x8219e48 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:15369 0x821fde7 tsubst_expr ../../src/gcc/cp/pt.c:14530 0x821de87 regenerate_decl_from_template ../../src/gcc/cp/pt.c:20022 0x821de87 instantiate_decl(tree_node*, int, bool) ../../src/gcc/cp/pt.c:20434 0x824c1a3 mark_used(tree_node*, int) ../../src/gcc/cp/decl2.c:5032 0x824c53d mark_used(tree_node*) ../../src/gcc/cp/decl2.c:5146 0x82b2e24 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int) ../../src/gcc/cp/semantics.c:3582 0x8267a2f cp_parser_primary_expression ../../src/gcc/cp/parser.c:4763 0x8268ab4 cp_parser_postfix_expression ../../src/gcc/cp/parser.c:6157 0x826acf0 cp_parser_unary_expression ../../src/gcc/cp/parser.c:7438 0x826b7f4 cp_parser_binary_expression ../../src/gcc/cp/parser.c:8172 0x826bdbb cp_parser_assignment_expression ../../src/gcc/cp/parser.c:8430 0x826c1f7 cp_parser_constant_expression ../../src/gcc/cp/parser.c:8676 0x8279d76 cp_parser_init_declarator ../../src/gcc/cp/parser.c:17270 0x827b0c0 cp_parser_simple_declaration ../../src/gcc/cp/parser.c:11607 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.