1999-01-26 Jason Merrill <jason@yorick.cygnus.com>
+ * tree.c (equal_functions): Fix name in prototype.
+
+ * decl.c (push_local_binding): Add FLAGS argument.
+ (pushdecl, push_overloaded_decl): Pass it.
+ * decl2.c (do_local_using_decl): Likewise.
+ * cp-tree.h: Adjust prototype.
+ * decl.c (poplevel): Fix logic.
+
* decl.c (push_local_binding): Also wrap used decls in a TREE_LIST.
(poplevel): Handle that. Fix logic for removing TREE_LISTs.
(cat_namespace_levels): Don't loop forever.
extern void cat_namespace_levels PROTO((void));
extern void fixup_anonymous_union PROTO((tree));
extern int check_static_variable_definition PROTO((tree, tree));
-extern void push_local_binding PROTO((tree, tree));
+extern void push_local_binding PROTO((tree, tree, int));
extern void push_class_binding PROTO((tree, tree));
extern tree check_default_argument PROTO((tree, tree));
extern tree push_overloaded_decl PROTO((tree, int));
}
}
-/* Bind DECL to ID in the current_binding_level. */
+/* Bind DECL to ID in the current_binding_level.
+ If PUSH_USING is set in FLAGS, we know that DECL doesn't really belong
+ to this binding level, that it got here through a using-declaration. */
void
-push_local_binding (id, decl)
+push_local_binding (id, decl, flags)
tree id;
tree decl;
+ int flags;
{
tree d = decl;
/* Create a new binding. */
push_binding (id, d, current_binding_level);
- if (TREE_CODE (decl) == OVERLOAD
- || (DECL_P (decl) && DECL_NAMESPACE_SCOPE_P (decl)))
+ if (TREE_CODE (decl) == OVERLOAD || (flags & PUSH_USING))
/* We must put the OVERLOAD into a TREE_LIST since the
TREE_CHAIN of an OVERLOAD is already used. Similarly for
decls that got here through a using-declaration. */
else
{
/* Remove the binding. */
- if (TREE_CODE (link) == TREE_LIST)
- link = TREE_VALUE (link);
- if (TREE_CODE_CLASS (TREE_CODE (link)) == 'd')
- pop_binding (DECL_NAME (link), link);
- else if (TREE_CODE (link) == OVERLOAD)
- pop_binding (DECL_NAME (OVL_FUNCTION (link)), link);
+ decl = link;
+ if (TREE_CODE (decl) == TREE_LIST)
+ decl = TREE_VALUE (decl);
+ if (TREE_CODE_CLASS (TREE_CODE (decl)) == 'd')
+ pop_binding (DECL_NAME (decl), decl);
+ else if (TREE_CODE (decl) == OVERLOAD)
+ pop_binding (DECL_NAME (OVL_FUNCTION (decl)), decl);
else
my_friendly_abort (0);
}
if (need_new_binding)
{
- push_local_binding (name, x);
+ push_local_binding (name, x, 0);
/* Because push_local_binding will hook X on to the
current_binding_level's name list, we don't want to
do that again below. */
}
/* Install the new binding. */
- push_local_binding (name, new_binding);
+ push_local_binding (name, new_binding, flags);
}
return decl;
static void propagate_binfo_offsets PROTO((tree, tree));
static int avoid_overlap PROTO((tree, tree));
static int lvalue_p_1 PROTO((tree, int));
-static int equal_function PROTO((tree, tree));
+static int equal_functions PROTO((tree, tree));
#define CEIL(x,y) (((x) + (y) - 1) / (y))