aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-07-15 14:21:35 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-07-15 10:21:35 -0400
commit2077e863e2ef50252c88f8278548673e919583bc (patch)
tree7941b5948eb1c2e59340753acff697efce891b20 /gcc/cp
parent8d9eb1141f0c6ffd846e3c8962a2e6fa92c68e63 (diff)
downloadgcc-2077e863e2ef50252c88f8278548673e919583bc.zip
gcc-2077e863e2ef50252c88f8278548673e919583bc.tar.gz
gcc-2077e863e2ef50252c88f8278548673e919583bc.tar.bz2
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: r21195
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/pt.c23
2 files changed, 16 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9b4b7af..dbbe414 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
1998-07-15 Jason Merrill <jason@yorick.cygnus.com>
+ * 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 ec53238..5d1d581 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)