]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/13323 (Template code does not compile in presence of typedef)
authorMark Mitchell <mark@codesourcery.com>
Sat, 6 Dec 2003 22:19:30 +0000 (22:19 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sat, 6 Dec 2003 22:19:30 +0000 (22:19 +0000)
PR c++/13323
* class.c (same_signature_p): Handle conversion operators
correctly.
(check_for_override): Likewise.

PR c++/13323
* g++.dg/inherit/operator2.C: New test.

From-SVN: r74372

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

index cc9ae8f6748f4786b134fa73567f19ab24a2fffb..6a14a2c76717fae96cfb87b48bdc4ff04ee4fc46 100644 (file)
@@ -1,3 +1,10 @@
+2003-12-06  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/13323
+       * class.c (same_signature_p): Handle conversion operators
+       correctly.
+       (check_for_override): Likewise.
+
 2003-11-14  Bernardo Innocenti  <bernie@develer.com>
 
        Backport from 3.4-branch.
index f6e03963bedc20cfda13c066fac5a7914729dfb6..6787269dc9ad6d9552037330d95a99a30644b50e 100644 (file)
@@ -2204,7 +2204,11 @@ same_signature_p (fndecl, base_fndecl)
   if (DECL_DESTRUCTOR_P (base_fndecl) || DECL_DESTRUCTOR_P (fndecl))
     return 0;
 
-  if (DECL_NAME (fndecl) == DECL_NAME (base_fndecl))
+  if (DECL_NAME (fndecl) == DECL_NAME (base_fndecl)
+      || (DECL_CONV_FN_P (fndecl)
+         && DECL_CONV_FN_P (base_fndecl)
+         && same_type_p (DECL_CONV_FN_TYPE (fndecl),
+                         DECL_CONV_FN_TYPE (base_fndecl))))
     {
       tree types, base_types;
       types = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
@@ -2631,7 +2635,8 @@ check_for_override (decl, ctype)
          override a virtual function from a base class.  */
     return;
   if ((DECL_DESTRUCTOR_P (decl)
-       || IDENTIFIER_VIRTUAL_P (DECL_NAME (decl)))
+       || IDENTIFIER_VIRTUAL_P (DECL_NAME (decl))
+       || DECL_CONV_FN_P (decl))
       && look_for_overrides (ctype, decl)
       && !DECL_STATIC_FUNCTION_P (decl))
     /* Set DECL_VINDEX to a value that is neither an INTEGER_CST nor
index 2565e9ecdefce89c098b617becb0085bc7a02be1..a857a0dc19199100ffb7f1e5230f636c907918ba 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-06  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/13323
+       * g++.dg/inherit/operator2.C: New test.
+
 2003-12-05  Stuart Menefy <stuart.menefy@st.com>
             J"orn Rennecke <joern.rennecke@superh.com>