[Bug c++/59113] New: [c++1y] ICE using auto as parameter in local function

reichelt at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 13 14:34:00 GMT 2013


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

            Bug ID: 59113
           Summary: [c++1y] ICE using auto as parameter in local function
           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=c++1y") triggers an ICE
on trunk:

=======================
void foo()
{
  void bar(auto) {}
}

auto i = 0;
=======================

bug.cc: In function 'void foo()':
bug.cc:3:18: error: a function-definition is not allowed here before '{' token
   void bar(auto) {}
                  ^
bug.cc: At global scope:
bug.cc:6:6: error: 'template<class auto:1> auto i' redeclared as different kind
of symbol
 auto i = 0;
      ^
bug.cc:6:6: note: previous declaration of 'auto i'
bug.cc:6:11: internal compiler error: in mangle_decl_string, at
cp/mangle.c:3426
 auto i = 0;
           ^
0x712eff mangle_decl_string
        ../../gcc/gcc/cp/mangle.c:3426
0x713000 get_mangled_id
        ../../gcc/gcc/cp/mangle.c:3468
0x713000 mangle_decl(tree_node*)
        ../../gcc/gcc/cp/mangle.c:3491
0xd3c6d0 decl_assembler_name(tree_node*)
        ../../gcc/gcc/tree.c:587
0xb2e23e wrapup_global_declaration_2(tree_node*)
        ../../gcc/gcc/toplev.c:403
0xb2e39b wrapup_global_declarations(tree_node**, int)
        ../../gcc/gcc/toplev.c:445
0x55e804 wrapup_globals_for_namespace(tree_node*, void*)
        ../../gcc/gcc/cp/decl.c:882
0x55b7ec walk_namespaces_r
        ../../gcc/gcc/cp/decl.c:844
0x629884 cp_write_global_declarations()
        ../../gcc/gcc/cp/decl2.c:4303
Please submit a full bug report, [etc.]



More information about the Gcc-bugs mailing list