http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60573
Bug ID: 60573 Summary: [c++1y] ICE with defining generic function of nested class in class scope Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org CC: abutcher at gcc dot gnu.org The following invalid code snippet (compiled with "-std=c++1y") triggers an ICE on trunk: ======================== struct A { struct B { void foo(auto); }; void B::foo(auto) {} }; ======================== bug.cc:8:19: internal compiler error: in poplevel_class, at cp/name-lookup.c:2951 void B::foo(auto) {} ^ 0x783517 poplevel_class() ../../gcc/gcc/cp/name-lookup.c:2951 0x666498 popclass() ../../gcc/gcc/cp/class.c:7129 0x6668fa pop_nested_class() ../../gcc/gcc/cp/class.c:7275 0x6c2961 cp_parser_direct_declarator ../../gcc/gcc/cp/parser.c:17519 0x6c2961 cp_parser_declarator ../../gcc/gcc/cp/parser.c:16986 0x6aaabd cp_parser_member_declaration ../../gcc/gcc/cp/parser.c:20397 0x6adefc cp_parser_member_specification_opt ../../gcc/gcc/cp/parser.c:20078 0x6adefc cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:19306 0x6b07b0 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:19533 0x6b07b0 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14331 0x6c8c80 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11567 0x6ce809 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:11157 0x6b2983 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:11106 0x6d9022 cp_parser_declaration ../../gcc/gcc/cp/parser.c:11003 0x6d7d18 cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10889 0x6d95ca cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4030 0x6d95ca c_parse_file() ../../gcc/gcc/cp/parser.c:31645 0x7f9d43 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1061 Please submit a full bug report, [etc.] Adam, you might want to have a look at this one.