Date: Sun, 27 Jul 2025 04:18:15 +0200
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_at_[hidden]>
Gesendet:So 27.07.2025 02:49
Betreff:Re: [std-proposals] Standardising 0xdeadbeef for pointers
An:std-proposals_at_[hidden];
CC:Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>;
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
Received on 2025-07-27 02:28:07