https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349

--- Comment #3 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 27 May 2020, redi at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95349
> 
> --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
> Using 
> 
>   auto t = new(p) std::uint64_t;
>   std::memcpy(t, std::launder(storage), sizeof(storage));
>   return t;
> 
> also prevents GCC from propagating the dynamic type of p to t.

So the language lawyer question is whether the testcase is valid
or not and what std::launder makes a difference semantics wise
(the dynamic type is still transfered, just the compiler no
longer knows which one it is).

Reply via email to