[Bug c++/58549] [4.9 Regression] [c++1y] ICE with local function in function with auto parameter

2013-11-12 Thread abutcher at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58549

--- Comment #6 from abutcher at gcc dot gnu.org ---
Author: abutcher
Date: Tue Nov 12 20:17:33 2013
New Revision: 204714

URL: http://gcc.gnu.org/viewcvs?rev=204714root=gccview=rev
Log:
Refactor implicit function template implementation and fix 58534, 58536, 58548,
58549 and 58637.

gcc/
* tree.c (grow_tree_vec_stat): New function ...
* tree.h (grow_tree_vec_stat) (grow_tree_vec): ... and its declaration
and macro front-end.

gcc/cp/
PR c++/58534
PR c++/58536
PR c++/58548
PR c++/58549
PR c++/58637
* parser.h (struct cp_parser): New members implicit_template_parms,
implicit_template_scope and auto_is_implicit_function_template_parm_p.
* parser.c (add_implicit_template_parms): Refactor as ...
(synthesize_implicit_template_parm): ... this to append a new template
type parm to the current template parameter list (introducing a new list
if necessary).  Removed push_deferring_access_checks.
(finish_fully_implicit_template): Removed pop_deferring_access_checks.
(cp_parser_new): Initialize new cp_parser members.
(cp_parser_parameter_declaration_clause): Consider auto as implicit
template parm when parsing a parameter declaration (unless parsing an
explicit specialization).
(cp_parser_parameter_declaration_list): Remove local
implicit_template_parms counter and reset cp_parser implicit template
state when complete.
(cp_parser_lambda_expression): Reset implicit template cp_parser members
whilst generating lambda class.
(cp_parser_function_definition_after_declarator): Reset implicit
template cp_parser members whilst parsing function definition.
(make_generic_type_name): Respell 'autoN' as 'auto:N' which works
better with template diagnostics.
(cp_parser_simple_type_specifier): Synthesize implicit template parm on
parsing 'auto' if auto_is_implicit_function_template_parm_p and provide
diagnostics ...
* decl.c (grokdeclarator): ... that were previously done here.

gcc/testsuite/g++.dg/
* cpp1y/pr58534.C: New testcase.
* cpp1y/pr58536.C: New testcase.
* cpp1y/pr58548.C: New testcase.
* cpp1y/pr58549.C: New testcase.
* cpp1y/pr58637.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/cpp1y/pr58534.C
trunk/gcc/testsuite/g++.dg/cpp1y/pr58536.C
trunk/gcc/testsuite/g++.dg/cpp1y/pr58548.C
trunk/gcc/testsuite/g++.dg/cpp1y/pr58549.C
trunk/gcc/testsuite/g++.dg/cpp1y/pr58637.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/parser.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree.c
trunk/gcc/tree.h


[Bug c++/58549] [4.9 Regression] [c++1y] ICE with local function in function with auto parameter

2013-11-12 Thread reichelt at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58549

Volker Reichelt reichelt at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Volker Reichelt reichelt at gcc dot gnu.org ---
Fixed by Adam's patch.


[Bug c++/58549] [4.9 Regression] [c++1y] ICE with local function in function with auto parameter

2013-11-05 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58549

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code,
   ||ice-on-valid-code
   Priority|P3  |P1


[Bug c++/58549] [4.9 Regression] [c++1y] ICE with local function in function with auto parameter

2013-09-29 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58549

Daniel Krügler daniel.kruegler at googlemail dot com changed:

   What|Removed |Added

 CC||daniel.kruegler@googlemail.
   ||com

--- Comment #4 from Daniel Krügler daniel.kruegler at googlemail dot com ---
This is invalid code (auto as decl-specifier only supported by polymorphic
lambda closures)

[Bug c++/58549] [4.9 Regression] [c++1y] ICE with local function in function with auto parameter

2013-09-29 Thread reichelt at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58549

--- Comment #5 from Volker Reichelt reichelt at gcc dot gnu.org ---
It's a GNU extension, see comment #2 in PR58536.


[Bug c++/58549] [4.9 Regression] [c++1y] ICE with local function in function with auto parameter

2013-09-27 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58549

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-09-27
 CC||mpolacek at gcc dot gnu.org
Summary|[c++1y] ICE with local  |[4.9 Regression] [c++1y]
   |function in function with   |ICE with local function in
   |auto parameter  |function with auto
   ||parameter
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek mpolacek at gcc dot gnu.org ---
Confirmed with trunk, 4.8:
q.C:1:10: error: parameter declared ‘auto’
 void foo(auto)
  ^
Are these auto parameters really valid?  What's their purpose?

[Bug c++/58549] [4.9 Regression] [c++1y] ICE with local function in function with auto parameter

2013-09-27 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58549

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.9.0


[Bug c++/58549] [4.9 Regression] [c++1y] ICE with local function in function with auto parameter

2013-09-27 Thread reichelt at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58549

--- Comment #2 from Volker Reichelt reichelt at gcc dot gnu.org ---
To me they look like a (syntactically simpler) alternative to template
parameters. They were introduced here:

 2013-09-16  Adam Butcher  a...@jessamine.co.uk

   * cp-tree.h (type_uses_auto_or_concept): Declare.
   (is_auto_or_concept): Declare.
   * decl.c (grokdeclarator): Allow 'auto' parameters in lambdas with
   -std=gnu++1y or -std=c++1y or, as a GNU extension, in plain functions.

[...]

[Bug c++/58549] [4.9 Regression] [c++1y] ICE with local function in function with auto parameter

2013-09-27 Thread mpolacek at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58549

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 CC||abutcher at gcc dot gnu.org

--- Comment #3 from Marek Polacek mpolacek at gcc dot gnu.org ---
Started with r202850.