This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix placement new if operator new has 2nd argument REFERENCE_TYPE (PR c++/34862)
- From: Jason Merrill <jason at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Ian Lance Taylor <iant at google dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 05 Feb 2008 12:25:30 -0500
- Subject: Re: [C++ PATCH] Fix placement new if operator new has 2nd argument REFERENCE_TYPE (PR c++/34862)
- References: <20080129130601.GL30691@devserv.devel.redhat.com>
It seems to me that this (and Ian's original patch) are approaching this
problem the wrong way: we shouldn't be trying to guess whether a pointer
is changing type based on the form of the call to new; this won't handle
a user-defined placement new, or a user-defined override of the
non-placement operator new which always returns the same pointer. Can't
we attach the CHANGE_DYNAMIC_TYPE_EXPR to the value returned from
operator new, rather than mess with the arguments?
Jason