aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-04-14 17:31:07 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-04-14 17:31:07 -0400
commit57c5e96e2d1fe52d818ec654251e2d260f903256 (patch)
treea45bc47298c3ea784b0b53d92e92a95be9493cae /gcc
parentc07ad89a044d379b5048441d0792c7a296502b2a (diff)
downloadgcc-57c5e96e2d1fe52d818ec654251e2d260f903256.zip
gcc-57c5e96e2d1fe52d818ec654251e2d260f903256.tar.gz
gcc-57c5e96e2d1fe52d818ec654251e2d260f903256.tar.bz2
* pt.c (lookup_template_class_1): Use coerce_innermost_template_parms.
From-SVN: r222104
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog2
-rw-r--r--gcc/cp/pt.c58
2 files changed, 6 insertions, 54 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3b166a7..dbf6330 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,7 @@
2015-04-14 Jason Merrill <jason@redhat.com>
+ * pt.c (lookup_template_class_1): Use coerce_innermost_template_parms.
+
PR c++/65695
* cvt.c (cp_fold_convert): Avoid wrapping PTRMEM_CST in NOP_EXPR.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 28a85eb..aed6f1c 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7724,60 +7724,10 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
/* Calculate the BOUND_ARGS. These will be the args that are
actually tsubst'd into the definition to create the
instantiation. */
- if (parm_depth > 1)
- {
- /* We have multiple levels of arguments to coerce, at once. */
- int i;
- int saved_depth = TMPL_ARGS_DEPTH (arglist);
-
- tree bound_args = make_tree_vec (parm_depth);
-
- for (i = saved_depth,
- t = DECL_TEMPLATE_PARMS (gen_tmpl);
- i > 0 && t != NULL_TREE;
- --i, t = TREE_CHAIN (t))
- {
- tree a;
- if (i == saved_depth)
- a = coerce_template_parms (TREE_VALUE (t),
- arglist, gen_tmpl,
- complain,
- /*require_all_args=*/true,
- /*use_default_args=*/true);
- else
- /* Outer levels should have already been coerced. */
- a = TMPL_ARGS_LEVEL (arglist, i);
-
- /* Don't process further if one of the levels fails. */
- if (a == error_mark_node)
- {
- /* Restore the ARGLIST to its full size. */
- TREE_VEC_LENGTH (arglist) = saved_depth;
- return error_mark_node;
- }
-
- SET_TMPL_ARGS_LEVEL (bound_args, i, a);
-
- /* We temporarily reduce the length of the ARGLIST so
- that coerce_template_parms will see only the arguments
- corresponding to the template parameters it is
- examining. */
- TREE_VEC_LENGTH (arglist)--;
- }
-
- /* Restore the ARGLIST to its full size. */
- TREE_VEC_LENGTH (arglist) = saved_depth;
-
- arglist = bound_args;
- }
- else
- arglist
- = coerce_template_parms (INNERMOST_TEMPLATE_PARMS (parmlist),
- INNERMOST_TEMPLATE_ARGS (arglist),
- gen_tmpl,
- complain,
- /*require_all_args=*/true,
- /*use_default_args=*/true);
+ arglist = coerce_innermost_template_parms (parmlist, arglist, gen_tmpl,
+ complain,
+ /*require_all_args=*/true,
+ /*use_default_args=*/true);
if (arglist == error_mark_node)
/* We were unable to bind the arguments. */