re PR c++/45473 (ICE: in dfs_walk_once, at cp/search.c:1659)

PR c++/45473
	* search.c (look_for_overrides): A constructor is never virtual.

From-SVN: r166391
This commit is contained in:
Jason Merrill 2010-11-05 21:44:31 -04:00 committed by Jason Merrill
parent 614122f4d8
commit e52a5db606
4 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2010-11-05 Jason Merrill <jason@redhat.com>
PR c++/45473
* search.c (look_for_overrides): A constructor is never virtual.
2010-11-05 Jakub Jelinek <jakub@redhat.com>
PR c++/46160

View File

@ -1935,6 +1935,11 @@ look_for_overrides (tree type, tree fndecl)
int ix;
int found = 0;
/* A constructor for a class T does not override a function T
in a base class. */
if (DECL_CONSTRUCTOR_P (fndecl))
return 0;
for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++)
{
tree basetype = BINFO_TYPE (base_binfo);

View File

@ -1,3 +1,8 @@
2010-11-05 Jason Merrill <jason@redhat.com>
PR c++/45473
* g++.dg/inherit/virtual6.C: New.
2010-11-05 Jakub Jelinek <jakub@redhat.com>
PR c/44772

View File

@ -0,0 +1,15 @@
// PR c++/45473
struct A
{
virtual void B ();
};
struct B : A
{
B ();
};
struct C : B
{
};