[C++ PATCH] Emit DECL_EXPR for vla_p new operator (PR c++/39367)
Mark Mitchell
mark@codesourcery.com
Fri Mar 6 17:06:00 GMT 2009
Jason Merrill wrote:
>> Certainly from a C++ type point of view, "new int[n]" has type "int *";
>> thus what we're doing seems like it could potentially even yield
>> incorrect information for typeid, throwing exceptions, etc. I don't
>> know if we correct that at some later point.
>
> We do. It seems that we're using an array type in the inner processing
> of new in order to use build_vec_init to initialize the allocated array,
> but I think we could accomplish the same thing by changing
> build_vec_init to handle getting a pointer as base.
That makes sense to me. I think at one point I was even looking at that
so as to make it easier (with -Os) to use the vector helper routines for
construction and such. What I wanted to do was to do set things up so
that we were conceptually ready to call those routines -- and then
expand them inline when not -Os.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc-patches
mailing list