https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41727
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code Status|UNCONFIRMED |NEW Last reconfirmed| |2017-02-07 CC| |msebor at gcc dot gnu.org Summary|inner template |[7 Regression] inner |specialization on non-type |template specialization on |arg template causes ICE |non-type arg template | |causes ICE Ever confirmed|0 |1 Known to fail| |4.5.3, 7.0 --- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- Confirmed with GCC 7.0 (see below). The ICE must have gone away and then reappeared. The first recent revision that triggers it is r243868. r243868 | jason | 2016-12-21 14:38:35 -0500 (Wed, 21 Dec 2016) | 5 lines Check that a partial specialization is more specialized. * pt.c (process_partial_specialization): Use get_partial_spec_bindings to check that the partial specialization is more specialized than the primary template. Before that, GCC failed to compile the test case with the following error so I'm marking this as a GCC 7 regression. t.C:97:6: error: invalid use of incomplete type ‘struct outer<outer_arg0>::inner<inner_arg0, value_wrap<999> >’ >::type ^~~~ t.C:18:5: note: declaration of ‘struct outer<outer_arg0>::inner<inner_arg0, value_wrap<999> >’ inner ^~~~~ $ /build/gcc-trunk/gcc/xgcc -B /build/gcc-trunk/gcc -O2 -S -Wall -Wextra -Wmaybe-uninitialized -Wuninitialized -xc++ t.C t.C: In substitution of ‘template<class InnerArg0, class InnerArg1> struct outer<outer_arg0>::inner [with InnerArg0 = outer_arg0; InnerArg1 = <missing>]’: t.C:70:5: required from here t.C:70:5: internal compiler error: tree check: accessed elt 2 of tree_vec with 1 elts in tsubst, at cp/pt.c:13424 inner ^~~~~ < InnerArg0 ~~~~~~~~~~~ , value_wrap ~~~~~~~~~~~~ #ifdef INNER_ARG1_NON_TYPE ~~~~~~~~~~~~~~~~~~~~~~~~~~ < InnerArg1NonType ~~~~~~~~~~~~~~~~~~ #else ~~~~~ < inner_arg1_non_type ~~~~~~~~~~~~~~~~~~~~~ #endif ~~~~~~ > ~ > ~ 0x14fb4e4 tree_vec_elt_check_failed(int, int, char const*, int, char const*) /src/gcc/trunk/gcc/tree.c:10012 0x7efcf3 tree_vec_elt_check(tree_node*, int, char const*, int, char const*) /src/gcc/trunk/gcc/tree.h:3281 0x8b0fda tsubst(tree_node*, tree_node*, int, tree_node*) /src/gcc/trunk/gcc/cp/pt.c:13424 0x8a3d34 tsubst_template_arg /src/gcc/trunk/gcc/cp/pt.c:10762 0x8a710a tsubst_template_args /src/gcc/trunk/gcc/cp/pt.c:11645 0x8a6d60 tsubst_template_args /src/gcc/trunk/gcc/cp/pt.c:11605 0x8b2617 tsubst(tree_node*, tree_node*, int, tree_node*) /src/gcc/trunk/gcc/cp/pt.c:13693 0x8d86ce get_partial_spec_bindings /src/gcc/trunk/gcc/cp/pt.c:21519 0x885c5f process_partial_specialization /src/gcc/trunk/gcc/cp/pt.c:4618 0x88a2b0 push_template_decl_real(tree_node*, bool) /src/gcc/trunk/gcc/cp/pt.c:5343 0x88ccdb push_template_decl(tree_node*) /src/gcc/trunk/gcc/cp/pt.c:5584 0x874a4d maybe_process_partial_specialization(tree_node*) /src/gcc/trunk/gcc/cp/pt.c:974 0x98b2ce cp_parser_class_head /src/gcc/trunk/gcc/cp/parser.c:22715 0x9893e3 cp_parser_class_specifier_1 /src/gcc/trunk/gcc/cp/parser.c:22031 0x98a494 cp_parser_class_specifier /src/gcc/trunk/gcc/cp/parser.c:22344 0x97e5cc cp_parser_type_specifier /src/gcc/trunk/gcc/cp/parser.c:16408 0x97957d cp_parser_decl_specifier_seq /src/gcc/trunk/gcc/cp/parser.c:13325 0x9924c7 cp_parser_single_declaration /src/gcc/trunk/gcc/cp/parser.c:26602 0x99178d cp_parser_template_declaration_after_parameters /src/gcc/trunk/gcc/cp/parser.c:26293 0x99235f cp_parser_explicit_template_declaration /src/gcc/trunk/gcc/cp/parser.c:26529 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.