+2003-11-14 Giovanni Bajo <giovannibajo@libero.it>
+
+ PR c++/2294
+ * name-lookup.c (push_overloaded_decl): Always construct an OVERLOAD
+ unless the declaration is a built-in.
+ (set_namespace_binding): While binding OVERLOADs with only one
+ declaration, we still need to call supplement_binding.
+
2003-11-14 Mark Mitchell <mark@codesourcery.com>
PR c++/12762
}
}
- if (old || TREE_CODE (decl) == TEMPLATE_DECL)
+ if (!DECL_ARTIFICIAL (decl))
{
if (old && TREE_CODE (old) != OVERLOAD)
new_binding = ovl_cons (decl, ovl_cons (old, NULL_TREE));
OVL_USED (new_binding) = 1;
}
else
- /* NAME is not ambiguous. */
new_binding = decl;
if (doing_global)
if (scope == NULL_TREE)
scope = global_namespace;
b = binding_for_name (NAMESPACE_LEVEL (scope), name);
- if (!b->value || TREE_CODE (val) == OVERLOAD || val == error_mark_node)
+ if (!b->value
+ /* If OVL_CHAIN is NULL, it's the first FUNCTION_DECL for this name,
+ and we still need to call supplement_binding. */
+ || (TREE_CODE (val) == OVERLOAD && OVL_CHAIN (val))
+ || val == error_mark_node)
b->value = val;
else
supplement_binding (b, val);