summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cp/search.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2003-11-07 02:43:04 +0000
committerkan <kan@FreeBSD.org>2003-11-07 02:43:04 +0000
commitb09448931ae541a7a60fd1cf0ebac14b627fba69 (patch)
tree980c917e2cc50183c4d566d9a0f9a1c818e6a6cd /contrib/gcc/cp/search.c
parentdc227ec3ae9a56f16c472206f51e4838bb53a644 (diff)
downloadFreeBSD-src-b09448931ae541a7a60fd1cf0ebac14b627fba69.zip
FreeBSD-src-b09448931ae541a7a60fd1cf0ebac14b627fba69.tar.gz
Gcc 3.3.3 20031106.
Diffstat (limited to 'contrib/gcc/cp/search.c')
-rw-r--r--contrib/gcc/cp/search.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/contrib/gcc/cp/search.c b/contrib/gcc/cp/search.c
index 4721a58..c43dd21 100644
--- a/contrib/gcc/cp/search.c
+++ b/contrib/gcc/cp/search.c
@@ -2855,8 +2855,27 @@ add_conversions (binfo, data)
/* Make sure we don't already have this conversion. */
if (! IDENTIFIER_MARKED (name))
{
- *conversions = tree_cons (binfo, tmp, *conversions);
- IDENTIFIER_MARKED (name) = 1;
+ tree t;
+
+ /* Make sure that we do not already have a conversion
+ operator for this type. Merely checking the NAME is not
+ enough because two conversion operators to the same type
+ may not have the same NAME. */
+ for (t = *conversions; t; t = TREE_CHAIN (t))
+ {
+ tree fn;
+ for (fn = TREE_VALUE (t); fn; fn = OVL_NEXT (fn))
+ if (same_type_p (TREE_TYPE (name),
+ DECL_CONV_FN_TYPE (OVL_CURRENT (fn))))
+ break;
+ if (fn)
+ break;
+ }
+ if (!t)
+ {
+ *conversions = tree_cons (binfo, tmp, *conversions);
+ IDENTIFIER_MARKED (name) = 1;
+ }
}
}
return NULL_TREE;
OpenPOWER on IntegriCloud