public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59113] New: [c++1y] ICE using auto as parameter in local function
@ 2013-11-13 14:34 reichelt at gcc dot gnu.org
  2013-11-25  7:44 ` [Bug c++/59113] " abutcher at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-11-13 14:34 UTC (permalink / raw)
  To: gcc-bugs

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.]


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/59113] [c++1y] ICE using auto as parameter in local function
  2013-11-13 14:34 [Bug c++/59113] New: [c++1y] ICE using auto as parameter in local function reichelt at gcc dot gnu.org
@ 2013-11-25  7:44 ` abutcher at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: abutcher at gcc dot gnu.org @ 2013-11-25  7:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from abutcher at gcc dot gnu.org ---
Author: abutcher
Date: Mon Nov 25 07:43:55 2013
New Revision: 205343

URL: http://gcc.gnu.org/viewcvs?rev=205343&root=gcc&view=rev
Log:
Disallow implicit function templates in local functions unless defining a
lambda.

gcc/cp/
    PR c++/59112
    PR c++/59113
    * parser.c (cp_parser_parameter_declaration_clause): Disallow implicit
    function templates in local functions unless defining a lambda.

gcc/testsuite/
    PR c++/59112
    PR c++/59113
    g++.dg/cpp1y/pr58533.C: Updated testcase.
    g++.dg/cpp1y/pr59112.C: New testcase.
    g++.dg/cpp1y/pr59113.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1y/pr59112.C
    trunk/gcc/testsuite/g++.dg/cpp1y/pr59113.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp1y/pr58533.C


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-25  7:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-13 14:34 [Bug c++/59113] New: [c++1y] ICE using auto as parameter in local function reichelt at gcc dot gnu.org
2013-11-25  7:44 ` [Bug c++/59113] " abutcher at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).