http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58980
Bug ID: 58980 Summary: [4.7/4.8/4.9 Regression] ICE with invalid enum declaration Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following invalid code snippet triggers an ICE since GCC 4.6.0: ============================== template<typename> struct A { enum A::B::C {}; }; ============================== bug.cc:3:14: internal compiler error: in is_ancestor, at cp/name-lookup.c:2721 enum A::B::C {}; ^ 0x718fff is_ancestor(tree_node*, tree_node*) ../../gcc/gcc/cp/name-lookup.c:2720 0x65b41e cp_parser_enum_specifier ../../gcc/gcc/cp/parser.c:15348 0x645d81 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14176 0x65e867 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11449 0x665c33 cp_parser_member_declaration ../../gcc/gcc/cp/parser.c:19931 0x645fdd cp_parser_member_specification_opt ../../gcc/gcc/cp/parser.c:19786 0x645fdd cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:19030 0x645fdd cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:19257 0x645fdd cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14204 0x65e867 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11449 0x664443 cp_parser_single_declaration ../../gcc/gcc/cp/parser.c:22748 0x66494c cp_parser_template_declaration_after_export ../../gcc/gcc/cp/parser.c:22624 0x670969 cp_parser_declaration ../../gcc/gcc/cp/parser.c:10849 0x66f4f8 cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10771 0x670e36 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4007 0x670e36 c_parse_file() ../../gcc/gcc/cp/parser.c:31045 0x791113 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1046 Please submit a full bug report, [etc.]