This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

--- Comment #4 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=204714&root=gcc&view=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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]