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.
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.
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),
--- /dev/null
+template <class T> T bar ();
+void bar () {}
+using :: bar;