+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
/* 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;
}
/* 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. */
--- /dev/null
+// 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" }