This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50594] Option -fwhole-program discards replaced new operator for std::string
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 04 Oct 2011 10:03:36 +0000
- Subject: [Bug c++/50594] Option -fwhole-program discards replaced new operator for std::string
- Auto-submitted: auto-generated
- References: <bug-50594-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50594
--- Comment #17 from rguenther at suse dot de <rguenther at suse dot de> 2011-10-04 10:03:36 UTC ---
On Tue, 4 Oct 2011, redi at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50594
>
> --- Comment #16 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-10-04 09:54:57 UTC ---
> I don't think they're special to the front end either, it transforms "new T"
> into a call to the relevant library allocation function and then invokes a
> constructor. The allocation functions are just ordinary functions implemented
> in libsupc++ but as weak symbols so they can be overridden. If we just declare
> them externally_visible in libsupc++'s <new> won't that work?
If it's required to include <new> to override them yes, but I doubt that
from looking at our testsuite ;)
Richard.