re PR c++/28253 (ICE with invalid covariant return)

2007-03-02  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/28253
	* class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
	for thunks.

From-SVN: r122490
This commit is contained in:
Simon Martin 2007-03-02 22:09:20 +00:00 committed by Simon Martin
parent f9dedbe3f1
commit 49fedf5af4
4 changed files with 30 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-03-02 Simon Martin <simartin@users.sourceforge.net>
PR c++/28253
* class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
for thunks.
2007-03-02 Geoffrey Keating <geoffk@apple.com>
* g++spec.c (lang_specific_driver): Add -lstdc++ when compiling

View File

@ -2097,7 +2097,8 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
fixed_offset, virtual_offset);
}
else
gcc_assert (!DECL_THUNK_P (fn));
gcc_assert (DECL_INVALID_OVERRIDER_P (overrider_target) ||
!DECL_THUNK_P (fn));
/* Assume that we will produce a thunk that convert all the way to
the final overrider, and not to an intermediate virtual base. */

View File

@ -1,3 +1,8 @@
2007-03-02 Simon Martin <simartin@users.sourceforge.net>
PR c++/28253
* g++.dg/inherit/covariant16.C: New test.
2007-03-02 Geoffrey Keating <geoffk@apple.com>
* g++.dg/other/darwin-minversion-1.C: New.

View File

@ -0,0 +1,17 @@
/* PR c++/28253 This used to ICE. */
/* { dg-do "compile" } */
struct A
{
virtual A* foo();
};
struct B : virtual A
{
virtual B* foo(); /* { dg-error "overriding" } */
};
struct C : B
{
virtual C& foo(); /* { dg-error "conflicting return type" } */
};