Commit 16a1369e by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/21983 (multiple diagnostics)

	PR c++/21983
	* class.c (find_final_overrider): Move diagnostic about no unique final
	overrider to...
	(update_vtable_entry_for_fn): ... here.

	* g++.dg/warn/pr21983.C: New test.

From-SVN: r104533
parent 861fd9a0
2005-09-22 Jakub Jelinek <jakub@redhat.com>
PR c++/21983
* class.c (find_final_overrider): Move diagnostic about no unique final
overrider to...
(update_vtable_entry_for_fn): ... here.
2005-09-21 Mark Mitchell <mark@codesourcery.com>
PR c++/23993
......
......@@ -1906,11 +1906,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 %qD in %qT", fn,
BINFO_TYPE (derived));
return error_mark_node;
}
return error_mark_node;
return ffod.candidates;
}
......@@ -1970,7 +1966,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 %qD in %qT", target_fn, t);
return;
}
overrider_target = overrider_fn = TREE_PURPOSE (overrider);
/* Check for adjusting covariant return types. */
......
2005-09-22 Jakub Jelinek <jakub@redhat.com>
PR c++/21983
* g++.dg/warn/pr21983.C: New test.
2005-09-21 Mark Mitchell <mark@codesourcery.com>
PR c++/23993
// PR c++/21983
// { dg-do compile }
struct B { virtual void foo () = 0; };
struct D1 : public virtual B { virtual void foo () {} };
struct D2 : public virtual B { virtual void foo () {} };
struct D : public D1, public D2 { }; // { dg-warning "no unique final overrider" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment