From 2b7d858c79410630f5a154874f394c5f95a7e2ad Mon Sep 17 00:00:00 2001 From: abutcher Date: Mon, 25 Nov 2013 07:43:55 +0000 Subject: 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205343 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/parser.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index aadecddc413..92b520b45ed 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2013-11-25 Adam Butcher + + PR c++/59112 + PR c++/59113 + * parser.c (cp_parser_parameter_declaration_clause): Disallow implicit + function templates in local functions unless defining a lambda. + 2013-11-23 Easwaran Raman PR c++/59031 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 141974745b1..d7092cc6759 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -18042,7 +18042,9 @@ cp_parser_parameter_declaration_clause (cp_parser* parser) (void) cleanup; if (!processing_specialization) - parser->auto_is_implicit_function_template_parm_p = true; + if (!current_function_decl + || (current_class_type && LAMBDA_TYPE_P (current_class_type))) + parser->auto_is_implicit_function_template_parm_p = true; /* Peek at the next token. */ token = cp_lexer_peek_token (parser->lexer); -- cgit v1.2.1