That is, why it is important to keep the abstract machine in mind.

 

It limits, what programmers can rely on.
 

-----Ursprüngliche Nachricht-----
Von: Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: So 27.07.2025 02:49
Betreff: Re: [std-proposals] Standardising 0xdeadbeef for pointers
An: std-proposals@lists.isocpp.org;
CC: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>;
On Sat, Jul 26, 2025 at 10:54 PM Jonathan Wakely wrote:
>
> Any value written to a non-static data member by the destructor is a
> dead store, it cannot be read after the destructor finishes. It is irrelevant
> whether the object was initialized using placement new.
>
> As it's a dead store, the compiler can remove that store completely.


Are you saying that the following program has undefined behaviour or
that it's not guaranteed to print "deadbeef"?

   https://godbolt.org/z/6bcnz95Ed