http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58533

            Bug ID: 58533
           Summary: [c++1y] ICE with auto in function pointer
           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 (compiled with "-std=gnu++1y") triggers an
ICE on trunk (4.9.0 20130922):

=========================
void foo()
{
  void (*fp)(auto);
}
=========================

bug.cc: In function 'void foo()':
bug.cc:3:18: error: template declaration of 'void (* fp)(__GenT0)'
   void (*fp)(auto);
                  ^
bug.cc: At global scope:
bug.cc:4:1: internal compiler error: in pop_binding, at cp/name-lookup.c:372
 }
 ^
0x6f246a pop_binding(tree_node*, tree_node*)
        ../../gcc/gcc/cp/name-lookup.c:372
0x549577 poplevel(int, int, int)
        ../../gcc/gcc/cp/decl.c:736
0x584488 end_template_decl()
        ../../gcc/gcc/cp/pt.c:3786
0x624dcb finish_fully_implicit_template
        ../../gcc/gcc/cp/parser.c:29032
0x6493a8 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:22350
0x64a079 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:22254
0x64a079 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16348
0x64a32f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:10986
0x64c190 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:10867
0x6551ae cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10764
0x653f0d cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10650
0x6557e6 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:3939
0x6557e6 c_parse_file()
        ../../gcc/gcc/cp/parser.c:28893
0x768164 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1046
Please submit a full bug report, [etc.]

Reply via email to