From: Jason Merrill Date: Wed, 4 Nov 2009 20:08:44 +0000 (-0500) Subject: re PR c++/35067 (multiple definition of virtual thunk) X-Git-Tag: releases/gcc-4.3.5~312 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29c0163c4ef58d5d22d9ab685a5914a0b7b3eee4;p=thirdparty%2Fgcc.git 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: r153913 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3fb5d3f5d6e2..7477e82161d0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-11-04 Jason Merrill + + PR c++/35067 + * method.c (use_thunk): Check DECL_WEAK as well as + DECL_ONE_ONLY. + 2009-11-04 Dodji Seketeli Revert fix for PR c++/37093 diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 3ef73fb8d047..c91fc4766ff3 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -381,7 +381,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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fcdd3edcdf07..130a5bcabffb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-11-04 Jason Merrill + + PR c++/35067 + * g++.dg/abi/thunk5.C: New. + 2009-11-04 Dodji Seketeli Revert fix for PR c++/37093 diff --git a/gcc/testsuite/g++.dg/abi/thunk5.C b/gcc/testsuite/g++.dg/abi/thunk5.C new file mode 100644 index 000000000000..15526bf9ee32 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/thunk5.C @@ -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;