From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22215 invoked by alias); 12 Nov 2013 20:17:41 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 21889 invoked by uid 55); 12 Nov 2013 20:17:38 -0000 From: "abutcher at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58548] [4.9 Regression] [c++1y] ICE with local struct in function with auto parameter Date: Tue, 12 Nov 2013 20:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: ice-on-valid-code, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: abutcher at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-11/txt/msg01162.txt.bz2 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 '' 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