+1999-03-03 Martin von Löwis <loewis@informatik.hu-berlin.de>
+
+ * decl.c (push_overloaded_decl): Only overwrite the old binding if
+ there was one.
+ * decl2.c (do_local_using_decl): Fix loop termination.
+
1999-03-02 Mark Mitchell <mark@markmitchell.com>
* cp-tree.h (determine_specialization): Don't declare.
else
{
/* We only create an OVERLOAD if there was a previous binding at
- this level. In that case, we need to remove the old binding
- and replace it with the new binding. We must also run
- through the NAMES on the binding level where the name was
- bound to update the chain. */
- if (TREE_CODE (new_binding) == OVERLOAD)
+ this level, or if decl is a template. In the former case, we
+ need to remove the old binding and replace it with the new
+ binding. We must also run through the NAMES on the binding
+ level where the name was bound to update the chain. */
+
+ if (TREE_CODE (new_binding) == OVERLOAD && old)
{
tree *d;
{
if (is_overloaded_fn (newval))
{
- tree fn;
+ tree fn, term;
/* We only need to push declarations for those functions
- that were not already bound in the current level. */
- for (fn = newval; fn != oldval; fn = OVL_NEXT (fn))
+ that were not already bound in the current level.
+ The old value might be NULL_TREE, it might be a single
+ function, or an OVERLOAD. */
+ if (oldval && TREE_CODE (oldval) == OVERLOAD)
+ term = OVL_FUNCTION (oldval);
+ else
+ term = oldval;
+ for (fn = newval; fn && OVL_CURRENT (fn) != term;
+ fn = OVL_NEXT (fn))
push_overloaded_decl (OVL_CURRENT (fn),
PUSH_LOCAL | PUSH_USING);
}