https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62207
Volker Reichelt <reichelt at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-checking Last reconfirmed|2014-12-14 00:00:00 |2017-06-05 CC| |reichelt at gcc dot gnu.org Summary|ICE: tree check: expected |[5/6/7/8 Regression] ICE: |tree that contains 'decl |tree check: expected tree |minimal' structure, have |that contains 'decl |'overload' in tsubst_copy, |minimal' structure, have |at cp/pt.c |'overload' in tsubst_copy, | |at cp/pt.c --- Comment #5 from Volker Reichelt <reichelt at gcc dot gnu.org> --- Marc's code snippet can be reduced to the following invalid code snippet that only generates one error before the ICE: ====================================== template<typename T> void foo(T) { X; X; } void X(); void X(int); void bar() { foo(0); } ====================================== PR62207.cc: In function 'void foo(T)': PR62207.cc:3:3: error: 'X' was not declared in this scope X; ^ PR62207.cc: In instantiation of 'void foo(T) [with T = int]': PR62207.cc:12:8: required from here PR62207.cc:4:3: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'overload' in tsubst_copy, at cp/pt.c:14628 X; ^ 0x1029944 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/gcc/tree.c:10031 0x7b04b6 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/gcc/tree.h:3197 0x7b04b6 tsubst_copy ../../gcc/gcc/cp/pt.c:14628 0x7b5fc5 tsubst_copy ../../gcc/gcc/cp/pt.c:14483 0x7b5fc5 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../gcc/gcc/cp/pt.c:17806 0x7a6128 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/gcc/cp/pt.c:16521 0x7a4d1b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/gcc/cp/pt.c:15785 0x7a4327 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/gcc/cp/pt.c:15998 0x7a1d90 instantiate_decl(tree_node*, bool, bool) ../../gcc/gcc/cp/pt.c:22963 0x7e33fb instantiate_pending_templates(int) ../../gcc/gcc/cp/pt.c:23084 0x6ca018 c_parse_final_cleanups() ../../gcc/gcc/cp/decl2.c:4511 Please submit a full bug report, [etc.] This is a regression that appeared in GCC 5.1.0.