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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And the original code from comment 0 now does:

$ ./a.out
1) Create an object and pass it over to a shared pointer...
   ptr.use_count() -> 1
2) Create an extra reference to that object...
   ptr.use_count() -> 2
3) Emulate 0xffffffff more references to that object...
Illegal instruction (core dumped)

So there's no way for the reference count to reach zero by creating lots of
copies, so no unsafe side effects after that point (because you can't reach
that point).

Reply via email to