This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
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