http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60390
Bug ID: 60390 Summary: [c++1y] ICE with declaring function with auto parameter as friend Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: ice-on-valid-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 valid code snippet (compiled with "-std=c++1y") triggers an ICE on trunk: =========================================== struct A { void foo(auto); }; struct B { friend void A::foo(auto); }; =========================================== bug.cc:8:26: internal compiler error: in poplevel_class, at cp/name-lookup.c:2951 friend void A::foo(auto); ^ 0x783a07 poplevel_class() ../../gcc/gcc/cp/name-lookup.c:2951 0x667d28 popclass() ../../gcc/gcc/cp/class.c:7129 0x66818a pop_nested_class() ../../gcc/gcc/cp/class.c:7275 0x6c2cf1 cp_parser_direct_declarator ../../gcc/gcc/cp/parser.c:17479 0x6c2cf1 cp_parser_declarator ../../gcc/gcc/cp/parser.c:16947 0x6ac38d cp_parser_member_declaration ../../gcc/gcc/cp/parser.c:20353 0x6afa74 cp_parser_member_specification_opt ../../gcc/gcc/cp/parser.c:20034 0x6afa74 cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:19268 0x6afa74 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:19495 0x6afa74 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14305 0x6c8f70 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11547 0x6cfb49 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:11137 0x6b2ff3 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:11086 0x6da2b2 cp_parser_declaration ../../gcc/gcc/cp/parser.c:10983 0x6d8fa8 cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10869 0x6da85a cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:4014 0x6da85a c_parse_file() ../../gcc/gcc/cp/parser.c:31595 0x7f9f53 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1060 Please submit a full bug report, [etc.] This is similar to PR60064. Adam, you might want to have a look.