[Bug c++/71251] New: ICE on invalid code, with unusual template name
rippey.e at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue May 24 01:24:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71251
Bug ID: 71251
Summary: ICE on invalid code, with unusual template name
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rippey.e at gmail dot com
Target Milestone: ---
With g++ trunk this code:
template<int,int>
template<typename>
using U=void;
template<typename,typename>
struct S1;
template<typename T>
struct S1<T,U<T>>{
template<typename>
struct S2:S2<T>{};
};
produces the following error message:
b1.cpp:11:16: internal compiler error: tree check: accessed elt 2 of tree_vec
with 1 elts in tsubst, at cp/pt.c:12961
struct S2:S2<T>{};
^
0x100f665 tree_vec_elt_check_failed(int, int, char const*, int, char const*)
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/tree.c:9950
0x722439 tree_vec_elt_check(tree_node const*, int, char const*, int, char
const*)
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/tree.h:3477
0x6ea386 tsubst(tree_node*, tree_node*, int, tree_node*)
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:12961
0x6e0dc0 tsubst_copy
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:14077
0x6e679b tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:17161
0x6db38a tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:15800
0x6fc6ea tsubst_template_args
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:11223
0x6fc9d2 tsubst_template_args
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:11183
0x6e9aac tsubst(tree_node*, tree_node*, int, tree_node*)
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:13213
0x6e9db8 tsubst(tree_node*, tree_node*, int, tree_node*)
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:12836
0x6fc6ea tsubst_template_args
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:11223
0x7011e4 tsubst_aggr_type
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:11420
0x6e9bd1 tsubst(tree_node*, tree_node*, int, tree_node*)
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:12889
0x6fe4ec lookup_template_class_1
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:8366
0x6fe4ec lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/pt.c:8638
0x811b9d finish_template_type(tree_node*, tree_node*, int)
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/semantics.c:3137
0x79d143 cp_parser_template_id
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/parser.c:14913
0x79d3fa cp_parser_class_name
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/parser.c:21210
0x78e6a1 cp_parser_qualifying_entity
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/parser.c:6238
0x78e6a1 cp_parser_nested_name_specifier_opt
/disk/0/erippey/gcc/b/objdir/../gcc/gcc/cp/parser.c:5924
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.
This appears to be a regression. The above code works on version 4.8.5 (though
it does require "--std=c++11" there).
More information about the Gcc-bugs
mailing list