]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/7676 (Member template function overloading problem)
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 18 Oct 2002 08:17:57 +0000 (08:17 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 18 Oct 2002 08:17:57 +0000 (08:17 +0000)
cp:
PR c++/7676
* class.c (add_method): Compare template parms too.
testsuite:
* g++.dg/overload/member2.C: New test.

From-SVN: r58281

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/ChangeLog

index 4de6af480f33e6b63d50c7030437d2746292f13f..491d84eed42398d0b2c838569207c93e9b84e625 100644 (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.
index 9ae0cf14419572b8981139eb69f0745be6390a2d..6bb1e4e945cd17545108b673423bc16ffe6ef775 100644 (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))
index 7129c2f5d420f6249e6bb8484e65e23c6889b1bd..cc1e7f6cce48076684f3cf4af402f143c2078382 100644 (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