Commit 9a0c4f5b by Jason Merrill

c++: Fix useless using-declaration.

Here reintroducing the same declarations into the global namespace via
using-declaration is useless but OK.  And a function and a function template
with the same parameters do not conflict.

gcc/cp/ChangeLog
2020-02-13  Jason Merrill  <jason@redhat.com>

	PR c++/93713
	* name-lookup.c (matching_fn_p): A function does not match a
	template.
parent abc79c64
2020-02-13 Jason Merrill <jason@redhat.com>
PR c++/93713
* name-lookup.c (matching_fn_p): A function does not match a
template.
PR c++/93643
PR c++/91476
* tree.c (decl_linkage): Always lk_none for locals.
......
......@@ -2321,12 +2321,14 @@ update_local_overload (cxx_binding *binding, tree newval)
static bool
matching_fn_p (tree one, tree two)
{
if (TREE_CODE (one) != TREE_CODE (two))
return false;
if (!compparms (TYPE_ARG_TYPES (TREE_TYPE (one)),
TYPE_ARG_TYPES (TREE_TYPE (two))))
return false;
if (TREE_CODE (one) == TEMPLATE_DECL
&& TREE_CODE (two) == TEMPLATE_DECL)
if (TREE_CODE (one) == TEMPLATE_DECL)
{
/* Compare template parms. */
if (!comp_template_parms (DECL_TEMPLATE_PARMS (one),
......
template <class T> T bar ();
void bar () {}
using :: bar;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment