mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-19 22:21:32 +08:00
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.
This commit is contained in:
parent
abc79c6498
commit
9a0c4f5b37
@ -1,5 +1,9 @@
|
||||
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),
|
||||
|
3
gcc/testsuite/g++.dg/lookup/using62.C
Normal file
3
gcc/testsuite/g++.dg/lookup/using62.C
Normal file
@ -0,0 +1,3 @@
|
||||
template <class T> T bar ();
|
||||
void bar () {}
|
||||
using :: bar;
|
Loading…
x
Reference in New Issue
Block a user