From 188bd10e805ea45c6d61b95555a0f6e526fd459a Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 15 Jul 1998 14:21:55 +0000 Subject: [PATCH] pt.c (complete_template_args): Don't look at the context unless we have to. * pt.c (complete_template_args): Don't look at the context unless we have to. From-SVN: r21196 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/pt.c | 23 +++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 477aac4aa76e..8d1fe7ba09e7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1998-07-15 Jason Merrill + * pt.c (complete_template_args): Don't look at the context unless + we have too. + * method.c (build_decl_overload_real): Fix namespace handling. * typeck.c (build_unary_op): Extract a lone function from an diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ec5323864f98..5d1d5811394d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -484,18 +484,21 @@ complete_template_args (tmpl, extra_args, unbound_only) template class, so skip over it. */ skip = (! is_member_template (tmpl)); - type = DECL_REAL_CONTEXT (tmpl); - for (i = depth; i; type = TYPE_CONTEXT (type)) - if (PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type))) - { - if (skip) - skip = 0; - else + if (depth > skip) + { + type = DECL_REAL_CONTEXT (tmpl); + for (i = depth; i; type = TYPE_CONTEXT (type)) + if (PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type))) { - --i; - TREE_VEC_ELT (new_args, i) = CLASSTYPE_TI_ARGS (type); + if (skip) + skip = 0; + else + { + --i; + TREE_VEC_ELT (new_args, i) = CLASSTYPE_TI_ARGS (type); + } } - } + } } if (extra_arg_depth == 1) -- 2.47.2