From: jason Date: Tue, 31 May 2016 19:49:22 +0000 (+0000) Subject: * pt.c (instantiate_decl): Avoid recalculation. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=074f7a322c7cb0787282d94d1e69279f24532488;p=thirdparty%2Fgcc.git * pt.c (instantiate_decl): Avoid recalculation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236947 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dabf2ec8d897..2850334efff7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 2016-05-31 Jason Merrill + * pt.c (instantiate_decl): Avoid recalculation. + PR c++/60095 PR c++/69515 PR c++/69009 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b25cd13659e3..64fef68c9e38 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -21971,7 +21971,6 @@ instantiate_decl (tree d, int defer_ok, else if (TREE_CODE (d) == FUNCTION_DECL) { hash_map *saved_local_specializations; - tree subst_decl; tree tmpl_parm; tree spec_parm; tree block = NULL_TREE; @@ -21994,18 +21993,17 @@ instantiate_decl (tree d, int defer_ok, access checked at template instantiation time, i.e now. These types were added to the template at parsing time. Let's get those and perform the access checks then. */ - perform_typedefs_access_check (DECL_TEMPLATE_RESULT (gen_tmpl), - gen_args); + perform_typedefs_access_check (DECL_TEMPLATE_RESULT (td), + args); /* Create substitution entries for the parameters. */ - subst_decl = DECL_TEMPLATE_RESULT (template_for_substitution (d)); - tmpl_parm = DECL_ARGUMENTS (subst_decl); + tmpl_parm = DECL_ARGUMENTS (code_pattern); spec_parm = DECL_ARGUMENTS (d); if (DECL_NONSTATIC_MEMBER_FUNCTION_P (d)) { register_local_specialization (spec_parm, tmpl_parm); spec_parm = skip_artificial_parms_for (d, spec_parm); - tmpl_parm = skip_artificial_parms_for (subst_decl, tmpl_parm); + tmpl_parm = skip_artificial_parms_for (code_pattern, tmpl_parm); } for (; tmpl_parm; tmpl_parm = DECL_CHAIN (tmpl_parm)) {