Message ID | 4CD4B2BC.2090709@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 0249fb0..76bf47c 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1935,6 +1935,9 @@ look_for_overrides (tree type, tree fndecl) int ix; int found = 0; + if (DECL_CONSTRUCTOR_P (fndecl)) + return 0; + for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ix++) { tree basetype = BINFO_TYPE (base_binfo); diff --git a/gcc/testsuite/g++.dg/inherit/virtual6.C b/gcc/testsuite/g++.dg/inherit/virtual6.C new file mode 100644 index 0000000..f036969 --- /dev/null +++ b/gcc/testsuite/g++.dg/inherit/virtual6.C @@ -0,0 +1,15 @@ +// PR c++/45473 + +struct A +{ + virtual void B (); +}; + +struct B : A +{ + B (); +}; + +struct C : B +{ +};