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: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Jason Merrill" <jason at redhat dot com>
- Cc: "Jakub Jelinek" <jakub at redhat dot com>, "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, 5 Feb 2008 19:59:33 +0100
- 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> <47A89C0A.9010201@redhat.com> <84fc9c000802050934h3743b2e9w4e4d12edb34bf7a8@mail.gmail.com> <47A8A58F.3070404@redhat.com>
On Feb 5, 2008 7:06 PM, Jason Merrill <jason@redhat.com> wrote:
> Richard Guenther wrote:
> > The problem arises at the point of inlining, where the optimizers need to see
> > that at the _beginning_ of the inlined new operator the dynamic type
> > of the storage is changing.
>
> Why? The new operator isn't doing anything to the storage.
In PR33407 an implementation of ::new (called by new expression) might
choose to zero-initialize storage for example. But you are probably right,
as the new type is in effect only at the point the new object is constructed
which happens by a constructor called on the result pointer.
Richard.