summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cp/class.c
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2006-08-26 21:29:10 +0000
committerkan <kan@FreeBSD.org>2006-08-26 21:29:10 +0000
commitab6c6e434e4ca0bf593007d49dee6eceb73286c0 (patch)
tree843ffc6140f66bf60562adb1bf8d3d82b9739b5e /contrib/gcc/cp/class.c
parent8a6911d2bb988a943624cbf4e4041b827d9ade53 (diff)
downloadFreeBSD-src-ab6c6e434e4ca0bf593007d49dee6eceb73286c0.zip
FreeBSD-src-ab6c6e434e4ca0bf593007d49dee6eceb73286c0.tar.gz
Gcc 3.4.6 as of 2006/08/25 #116475.
Diffstat (limited to 'contrib/gcc/cp/class.c')
-rw-r--r--contrib/gcc/cp/class.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/contrib/gcc/cp/class.c b/contrib/gcc/cp/class.c
index 09daf11..c14313c 100644
--- a/contrib/gcc/cp/class.c
+++ b/contrib/gcc/cp/class.c
@@ -879,9 +879,10 @@ add_method (tree type, tree method, int error_p)
fns = OVL_NEXT (fns))
{
tree fn = OVL_CURRENT (fns);
+ tree fn_type;
+ tree method_type;
tree parms1;
tree parms2;
- bool same = 1;
if (TREE_CODE (fn) != TREE_CODE (method))
continue;
@@ -896,8 +897,10 @@ add_method (tree type, tree method, int error_p)
functions in the derived class override and/or hide member
functions with the same name and parameter types in a base
class (rather than conflicting). */
- parms1 = TYPE_ARG_TYPES (TREE_TYPE (fn));
- parms2 = TYPE_ARG_TYPES (TREE_TYPE (method));
+ fn_type = TREE_TYPE (fn);
+ method_type = TREE_TYPE (method);
+ parms1 = TYPE_ARG_TYPES (fn_type);
+ parms2 = TYPE_ARG_TYPES (method_type);
/* Compare the quals on the 'this' parm. Don't compare
the whole types, as used functions are treated as
@@ -906,23 +909,25 @@ add_method (tree type, tree method, int error_p)
&& ! DECL_STATIC_FUNCTION_P (method)
&& (TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms1)))
!= TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms2)))))
- same = 0;
+ continue;
/* 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;
+ && (!same_type_p (TREE_TYPE (fn_type),
+ TREE_TYPE (method_type))
+ || !comp_template_parms (DECL_TEMPLATE_PARMS (fn),
+ DECL_TEMPLATE_PARMS (method))))
+ continue;
if (! DECL_STATIC_FUNCTION_P (fn))
parms1 = TREE_CHAIN (parms1);
if (! DECL_STATIC_FUNCTION_P (method))
parms2 = TREE_CHAIN (parms2);
- if (same && compparms (parms1, parms2)
+ if (compparms (parms1, parms2)
&& (!DECL_CONV_FN_P (fn)
- || same_type_p (TREE_TYPE (TREE_TYPE (fn)),
- TREE_TYPE (TREE_TYPE (method)))))
+ || same_type_p (TREE_TYPE (fn_type),
+ TREE_TYPE (method_type))))
{
if (using && DECL_CONTEXT (fn) == type)
/* Defer to the local function. */
@@ -2035,11 +2040,7 @@ find_final_overrider (tree derived, tree binfo, tree fn)
/* If there was no winner, issue an error message. */
if (!ffod.candidates || TREE_CHAIN (ffod.candidates))
- {
- error ("no unique final overrider for `%D' in `%T'", fn,
- BINFO_TYPE (derived));
- return error_mark_node;
- }
+ return error_mark_node;
return ffod.candidates;
}
@@ -2099,7 +2100,10 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
/* Find the final overrider. */
overrider = find_final_overrider (TYPE_BINFO (t), b, target_fn);
if (overrider == error_mark_node)
- return;
+ {
+ error ("no unique final overrider for `%D' in `%T'", target_fn, t);
+ return;
+ }
overrider_target = overrider_fn = TREE_PURPOSE (overrider);
/* Check for adjusting covariant return types. */
OpenPOWER on IntegriCloud