aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorAdam Butcher <adam@jessamine.co.uk>2013-11-12 20:17:33 +0000
committerAdam Butcher <abutcher@gcc.gnu.org>2013-11-12 20:17:33 +0000
commit0dca5025f02ad920b12cede50c7968768decee19 (patch)
treedd7d73f2767b4b7b3797611c8cc9aea5b69ed13d /gcc/tree.h
parent27297d2d1b7731db604400f335e4653da7c09a22 (diff)
downloadgcc-0dca5025f02ad920b12cede50c7968768decee19.zip
gcc-0dca5025f02ad920b12cede50c7968768decee19.tar.gz
gcc-0dca5025f02ad920b12cede50c7968768decee19.tar.bz2
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. From-SVN: r204714
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 3633caf..9c2f2d0 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -3430,6 +3430,11 @@ extern tree make_tree_binfo_stat (unsigned MEM_STAT_DECL);
extern tree make_tree_vec_stat (int MEM_STAT_DECL);
#define make_tree_vec(t) make_tree_vec_stat (t MEM_STAT_INFO)
+/* Grow a TREE_VEC. */
+
+extern tree grow_tree_vec_stat (tree v, int MEM_STAT_DECL);
+#define grow_tree_vec(v, t) grow_tree_vec_stat (v, t MEM_STAT_INFO)
+
/* Return the (unique) IDENTIFIER_NODE node for a given name.
The name is supplied as a char *. */