aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-12-06 22:11:45 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-12-06 22:11:45 +0000
commita6c0d7722409af95b4e7c0e718bf85a07d679dcd (patch)
treee8af9134037c4b519c2df775026d650d51634041 /gcc/cp/class.c
parent9be6533af6dcbffc1f2ae91d7d108cf5171b75d4 (diff)
downloadgcc-a6c0d7722409af95b4e7c0e718bf85a07d679dcd.zip
gcc-a6c0d7722409af95b4e7c0e718bf85a07d679dcd.tar.gz
gcc-a6c0d7722409af95b4e7c0e718bf85a07d679dcd.tar.bz2
re PR c++/13323 (Template code does not compile in presence of typedef)
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: r74370
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 1e1b71c..72f03a2 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1900,7 +1900,11 @@ same_signature_p (tree fndecl, tree 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));
@@ -2439,7 +2443,8 @@ check_for_override (tree decl, tree 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