https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86661
Bug ID: 86661
Summary: g++ ICE:tree check: expected tree that contains ‘decl
minimal’ structure, have ‘overload’ in
note_name_declared_in_class, at cp/class.c:8288
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: helloqirun at gmail dot com
Target Milestone: ---
clang++ could compile it. It appears to be a recent regression.
$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 9.0.0 20180724 (experimental) [trunk revision 262942] (GCC)
$ g++-trunk abc.C
abc.C:5:31: internal compiler error: tree check: expected tree that contains
‘decl minimal’ structure, have ‘overload’ in note_name_declared_in_class, at
cp/class.c:8288
template <typename> void a();
^
0x78fc6e tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/gcc/tree.c:9523
0x5e5d0c contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3228
0x5e5d0c note_name_declared_in_class(tree_node*, tree_node*)
../../gcc/gcc/cp/class.c:8288
0x90e2aa push_class_level_binding_1
../../gcc/gcc/cp/name-lookup.c:4656
0x90e2aa push_class_level_binding(tree_node*, tree_node*)
../../gcc/gcc/cp/name-lookup.c:4681
0x84d79d add_method(tree_node*, tree_node*, bool)
../../gcc/gcc/cp/class.c:1156
0x9b79e3 finish_member_declaration(tree_node*)
../../gcc/gcc/cp/semantics.c:3107
0x94fc67 cp_parser_template_declaration_after_parameters
../../gcc/gcc/cp/parser.c:27113
0x95047e cp_parser_explicit_template_declaration
../../gcc/gcc/cp/parser.c:27272
0x95047e cp_parser_template_declaration_after_export
../../gcc/gcc/cp/parser.c:27291
0x93b9fd cp_parser_member_declaration
../../gcc/gcc/cp/parser.c:23593
0x93c898 cp_parser_member_specification_opt
../../gcc/gcc/cp/parser.c:23520
0x93c898 cp_parser_class_specifier_1
../../gcc/gcc/cp/parser.c:22664
0x93e59d cp_parser_class_specifier
../../gcc/gcc/cp/parser.c:22926
0x93e59d cp_parser_type_specifier
../../gcc/gcc/cp/parser.c:16907
0x94b113 cp_parser_decl_specifier_seq
../../gcc/gcc/cp/parser.c:13748
0x9507b0 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:13058
0x9558b2 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12903
0x955cad cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12779
0x9563fa cp_parser_namespace_body
../../gcc/gcc/cp/parser.c:18753
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.
$ cat abc.C
typedef int a;
namespace {
class b {
a c;
template <typename> void a();
};
}