On Thu, 28 Jul 2022 at 20:34, Артём Колпаков via Std-Discussion <std-discussion@lists.isocpp.org> wrote:
To the topic. In the following sentence of the standard: "The lifetime ([basic.life]) of an object referenced by *ptr shall exceed the lifetime of all atomic_­refs that reference the object.", I can't understand why, instead of lifetime restrictions, do not prohibit the use of std::atomic_ref after the lifetime of the referenced object ends (like dangling references). This is inconvenient, because before deleting an object, you have to delete atomic_ref. Even more, the restriction from the standard does not allow, as it seems to me, to use valid programs.

This restriction is termed "pointer lifetime-end zap". See https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1726r5.pdf for historical background; https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2414r1.pdf and https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2188r1.html for some proposed approaches to a solution.