+ decl_scope_table[decl_scope_depth].scope = scope;
+
+ /* Sometimes, while recursively emitting subtypes within a class type,
+ we end up recuring on a subtype at a higher level then the current
+ subtype. In such a case, we need to search the decl_scope_table to
+ find the parent of this subtype. */
+
+ if (TREE_CODE_CLASS (TREE_CODE (scope)) == 't')
+ containing_scope = TYPE_CONTEXT (scope);
+ else
+ containing_scope = NULL_TREE;
+
+ /* The normal case. */
+ if (decl_scope_depth == 0
+ || containing_scope == NULL_TREE
+ /* Ignore namespaces for the moment. */
+ || TREE_CODE (containing_scope) == NAMESPACE_DECL
+ || containing_scope == decl_scope_table[decl_scope_depth - 1].scope)
+ decl_scope_table[decl_scope_depth].previous = decl_scope_depth - 1;
+ else
+ {
+ /* We need to search for the containing_scope. */
+ for (i = 0; i < decl_scope_depth; i++)
+ if (decl_scope_table[i].scope == containing_scope)
+ break;
+
+ if (i == decl_scope_depth)
+ abort ();
+ else
+ decl_scope_table[decl_scope_depth].previous = i;
+ }
+
+ decl_scope_depth++;