[PATCH] tweak -Wplacement-new to fix #69662

Jason Merrill jason@redhat.com
Thu Feb 4 21:10:00 GMT 2016


On 02/04/2016 03:22 PM, Martin Sebor wrote:
> +  /* Refers to the declared object that constains the subobject referenced
> +     by OPER.  When the object is initialized, makes it possible to determine
> +     the actual size of a flexible array member used as the buffer passed
> +     as OPER to placement new.  */
> +  tree var_decl = NULL_TREE;

This doesn't make sense to me.  There should never be variables of types 
with flexible array members; such types should be allocated with malloc 
or the equivalent, along with enough extra space for the trailing array. 
  Indeed, the C compiler gives an error for initialization of a flexible 
array member.

Jason



More information about the Gcc-patches mailing list