* class.c (add_method): Correct handling of conversion operators.
authorMark Mitchell <mark@codesourcery.com>
Fri, 12 Jul 2002 07:55:16 +0000 (07:55 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 12 Jul 2002 07:55:16 +0000 (07:55 +0000)
From-SVN: r55419

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

index 38de1a298e586c3023f62659b8aac5e0d461b5ae..e2e1836a235ebfa8c035709777eb116c51f158e2 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-12  Mark Mitchell  <mark@codesourcery.com>
+
+       * class.c (add_method): Correct handling of conversion operators.
+
 2002-07-11  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/7224
index 5222665f7bdf1c1d027ba8e1761dc385314f0e57..b59c7ce22ea09d00940bb0f486045a3a0a490f66 100644 (file)
@@ -999,7 +999,10 @@ add_method (type, method, error_p)
          if (! DECL_STATIC_FUNCTION_P (method))
            parms2 = TREE_CHAIN (parms2);
 
-         if (same && compparms (parms1, parms2))
+         if (same && compparms (parms1, parms2) 
+             && (!DECL_CONV_FN_P (fn) 
+                 || same_type_p (TREE_TYPE (TREE_TYPE (fn)),
+                                 TREE_TYPE (TREE_TYPE (method)))))
            {
              if (using && DECL_CONTEXT (fn) == type)
                /* Defer to the local function.  */