http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58548
Bug ID: 58548 Summary: ICE with local struct in function with auto parameter 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 code snippet triggers an ICE on trunk (4.9.0 20130926) when compiled with "-std=gnu++1y": =========================== void foo(auto) { struct A { int i; }; } =========================== bug.cc: In function 'void foo(<auto1>)': bug.cc:3:18: error: data member 'i' cannot be a member template struct A { int i; }; ^ neu40.cc:6:18: internal compiler error: in poplevel, at cp/decl.c:560 0x554850 poplevel(int, int, int) ../../gcc/gcc/cp/decl.c:560 0x58e568 end_template_decl() ../../gcc/gcc/cp/pt.c:3786 0x62ed7b finish_fully_implicit_template ../../gcc/gcc/cp/parser.c:29040 0x637ad1 cp_parser_member_declaration ../../gcc/gcc/cp/parser.c:20086 0x6381ee cp_parser_member_specification_opt ../../gcc/gcc/cp/parser.c:19630 0x6381ee cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:18885 0x63ab90 cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:19101 0x63ab90 cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14080 0x6500a9 cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11328 0x654139 cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:10918 0x656140 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10867 0x657230 cp_parser_declaration_statement ../../gcc/gcc/cp/parser.c:10514 0x63fad7 cp_parser_statement ../../gcc/gcc/cp/parser.c:9274 0x640dde cp_parser_statement_seq_opt ../../gcc/gcc/cp/parser.c:9552 0x640f26 cp_parser_compound_statement ../../gcc/gcc/cp/parser.c:9506 0x6522db cp_parser_function_body ../../gcc/gcc/cp/parser.c:18318 0x6522db cp_parser_ctor_initializer_opt_and_function_body ../../gcc/gcc/cp/parser.c:18354 0x65331f cp_parser_function_definition_after_declarator ../../gcc/gcc/cp/parser.c:22338 0x654027 cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/gcc/cp/parser.c:22259 0x654027 cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:16347 Please submit a full bug report, [etc.] Furthermore, IMHO the error message is bogus and the code should be accepted.