re PR c++/35067 (multiple definition of virtual thunk)

PR c++/35067
	* method.c (use_thunk): Check DECL_WEAK as well as
	DECL_ONE_ONLY.

From-SVN: r153912
This commit is contained in:
Jason Merrill 2009-11-04 14:55:56 -05:00 committed by Jason Merrill
parent dd214bf45e
commit ed19fcbc73
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-11-04 Jason Merrill <jason@redhat.com>
PR c++/35067
* method.c (use_thunk): Check DECL_WEAK as well as
DECL_ONE_ONLY.
2009-11-03 Jason Merrill <jason@redhat.com>
PR c++/36959

View File

@ -380,7 +380,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function);
DECL_VISIBILITY_SPECIFIED (thunk_fndecl)
= DECL_VISIBILITY_SPECIFIED (function);
if (DECL_ONE_ONLY (function))
if (DECL_ONE_ONLY (function) || DECL_WEAK (function))
make_decl_one_only (thunk_fndecl);
if (flag_syntax_only)

View File

@ -1,3 +1,8 @@
2009-11-04 Jason Merrill <jason@redhat.com>
PR c++/35067
* g++.dg/abi/thunk5.C: New.
2009-11-04 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/pr41900.c: New test.

View File

@ -0,0 +1,13 @@
// PR c++/35067
// The thunks should be weak even on targets without one-only support.
// { dg-require-weak "" }
// { dg-final { scan-assembler "weak.*ZTv" } }
struct A
{
virtual ~A() { }
};
struct B: virtual A { };
B b;