From f42054423ce58a79e82471c292996818157e17ad Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 12 Oct 2007 09:53:27 +0000 Subject: [PATCH] pt.c (tsubst): Use template_parm_level_and_index. 2007-10-12 Paolo Carlini * pt.c (tsubst): Use template_parm_level_and_index. From-SVN: r129257 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/pt.c | 13 +------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index faea90d1e3c..075e2096dc9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2007-10-12 Paolo Carlini + + * pt.c (tsubst): Use template_parm_level_and_index. + 2007-10-12 Jakub Jelinek PR c++/32121 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index fe2a739d40c..c3ce0d13734 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8669,18 +8669,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) r = NULL_TREE; gcc_assert (TREE_VEC_LENGTH (args) > 0); - if (TREE_CODE (t) == TEMPLATE_TYPE_PARM - || TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM - || TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM) - { - idx = TEMPLATE_TYPE_IDX (t); - level = TEMPLATE_TYPE_LEVEL (t); - } - else - { - idx = TEMPLATE_PARM_IDX (t); - level = TEMPLATE_PARM_LEVEL (t); - } + template_parm_level_and_index (t, &level, &idx); levels = TMPL_ARGS_DEPTH (args); if (level <= levels)