re PR c++/7676 (Member template function overloading problem)

cp:
	PR c++/7676
	* class.c (add_method): Compare template parms too.
testsuite:
	* g++.dg/overload/member2.C: New test.

From-SVN: r58281
This commit is contained in:
Nathan Sidwell 2002-10-18 08:17:57 +00:00 committed by Nathan Sidwell
parent d909ffcfd0
commit 4d054123bf
3 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2002-10-18 Nathan Sidwell <nathan@codesourcery.com>
PR c++/7676
* class.c (add_method): Compare template parms too.
2002-10-17 Mark Mitchell <mark@codesourcery.com>
* mangle.c (globals): Add entity and need_abi_warning.

View File

@ -945,6 +945,13 @@ add_method (type, method, error_p)
&& (TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms1)))
!= TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms2)))))
same = 0;
/* For templates, the template parms must be identical. */
if (TREE_CODE (fn) == TEMPLATE_DECL
&& !comp_template_parms (DECL_TEMPLATE_PARMS (fn),
DECL_TEMPLATE_PARMS (method)))
same = 0;
if (! DECL_STATIC_FUNCTION_P (fn))
parms1 = TREE_CHAIN (parms1);
if (! DECL_STATIC_FUNCTION_P (method))

View File

@ -1,3 +1,8 @@
2002-10-18 Nathan Sidwell <nathan@codesourcery.com>
PR c++/7676
* g++.dg/overload/method2.C: New test.
2002-10-17 Mark Mitchell <mark@codesourcery.com>
PR c++/7584