pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting a function context.
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 19 Mar 1998 02:54:39 +0000 (02:54 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 19 Mar 1998 02:54:39 +0000 (21:54 -0500)
* pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting
a function context.

From-SVN: r18702

gcc/cp/ChangeLog
gcc/cp/pt.c

index 5c45847a8b16fd2ae616fa78678a80d1a4d4bc4c..45e0de07a09485e5c4a67a482afbe4c1d102531a 100644 (file)
@@ -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.
 
index 865893e720e7ce02d62c2daedfc7e7069cb58cb1..7609ee51c55b633036065ceac8bb2b89a9800b4e 100644 (file)
@@ -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;