Commit 0978790f by Jason Merrill Committed by Jason Merrill

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
parent 78957a2a
Thu Mar 19 02:27:48 1998 Jason Merrill <jason@yorick.cygnus.com> 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. * decl.c (store_bindings): Use free_binding_vecs.
(pop_from_top_level): Likewise. (pop_from_top_level): Likewise.
......
...@@ -4421,10 +4421,12 @@ tsubst_copy (t, args, in_decl) ...@@ -4421,10 +4421,12 @@ tsubst_copy (t, args, in_decl)
case FIELD_DECL: case FIELD_DECL:
if (DECL_CONTEXT (t)) if (DECL_CONTEXT (t))
{ {
tree ctx = tsubst (DECL_CONTEXT (t), args, in_decl); tree ctx;
if (ctx == current_function_decl) if (TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL)
return lookup_name (DECL_NAME (t), 0); 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 lookup_field (ctx, DECL_NAME (t), 0, 0);
} }
return t; return t;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment