This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add a new type attribute always_alias (PR79671)


On 04/10/2017 01:50 PM, Richard Biener wrote:

> +void *operator new(__SIZE_TYPE__, void *p2) { return p2; }
> +struct B { B(int i_) : i(i_) {} int i; };
> +struct X
> +{
> +  unsigned char buf[sizeof (B)];
> +};

Pedantically, shouldn't there be something here to enforce
X's alignment to be at least the same as B's ?

> +
> +int __attribute__((noinline)) foo()
> +{
> +  X x, y;
> +  new (&x) B (0);

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]