aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1998-03-19 02:54:39 +0000
committerJason Merrill <jason@gcc.gnu.org>1998-03-18 21:54:39 -0500
commit0978790f4fe82534547b0ee4c763caabbae578d7 (patch)
tree8aff104937071e75ff06e0d69f3f236f84e5238a /gcc
parent78957a2a8c2ba7a446029dc32830d415b565334e (diff)
downloadgcc-0978790f4fe82534547b0ee4c763caabbae578d7.zip
gcc-0978790f4fe82534547b0ee4c763caabbae578d7.tar.gz
gcc-0978790f4fe82534547b0ee4c763caabbae578d7.tar.bz2
pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting a function context.
* pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting a function context. From-SVN: r18702
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/pt.c8
2 files changed, 8 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5c45847..45e0de0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
Thu Mar 19 02:27:48 1998 Jason Merrill <jason@yorick.cygnus.com>
+ * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting
+ a function context.
+
* decl.c (store_bindings): Use free_binding_vecs.
(pop_from_top_level): Likewise.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 865893e..7609ee5 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4421,10 +4421,12 @@ tsubst_copy (t, args, in_decl)
case FIELD_DECL:
if (DECL_CONTEXT (t))
{
- tree ctx = tsubst (DECL_CONTEXT (t), args, in_decl);
- if (ctx == current_function_decl)
+ tree ctx;
+ if (TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL)
return lookup_name (DECL_NAME (t), 0);
- else if (ctx != DECL_CONTEXT (t))
+
+ ctx = tsubst (DECL_CONTEXT (t), args, in_decl);
+ if (ctx != DECL_CONTEXT (t))
return lookup_field (ctx, DECL_NAME (t), 0, 0);
}
return t;