+Mon Sep 8 02:33:20 1997 Jody Goldberg <jodyg@idt.net>
+
+ * decl.c (current_local_enum): Remove static.
+ * pt.c (tsubst_enum): Save and restore value of current_local_enum
+ in case template is expanded in enum decl.
+ (instantiate_class_template) : Use new tsubst_enum signature.
+ (tsubst_expr): Likewise.
+
Mon Sep 8 01:21:43 1997 Mark Mitchell <mmitchell@usa.net>
* pt.c (begin_member_template_processing): Take a function as
static int list_eq PROTO((tree, tree));
static tree get_class_bindings PROTO((tree, tree, tree));
static tree coerce_template_parms PROTO((tree, tree, tree));
-static tree tsubst_enum PROTO((tree, tree, int));
+static tree tsubst_enum PROTO((tree, tree, int, tree *));
static tree add_to_template_args PROTO((tree, tree));
/* Restore the template parameter context. */
if (TREE_CODE (tag) == ENUMERAL_TYPE)
{
tree e, newtag = tsubst_enum (tag, args,
- TREE_VEC_LENGTH (args));
+ TREE_VEC_LENGTH (args), field_chain);
- *field_chain = grok_enum_decls (newtag, NULL_TREE);
while (*field_chain)
{
DECL_FIELD_CONTEXT (*field_chain) = type;
lineno = TREE_COMPLEXITY (t);
t = TREE_TYPE (t);
if (TREE_CODE (t) == ENUMERAL_TYPE)
- tsubst_enum (t, args, nargs);
+ tsubst_enum (t, args, nargs, NULL);
break;
default:
tsubst_expr. */
static tree
-tsubst_enum (tag, args, nargs)
+tsubst_enum (tag, args, nargs, field_chain)
tree tag, args;
int nargs;
+ tree * field_chain;
{
+ extern tree current_local_enum;
+ tree prev_local_enum = current_local_enum;
+
tree newtag = start_enum (TYPE_IDENTIFIER (tag));
tree e, values = NULL_TREE;
finish_enum (newtag, values);
+ if (NULL != field_chain)
+ *field_chain = grok_enum_decls (newtag, NULL_TREE);
+
+ current_local_enum = prev_local_enum;
+
return newtag;
}