On Sun, 23 Aug 2026 at 22:40, Ville Voutilainen <[email protected]> wrote: > > On Sun, 23 Aug 2026 at 22:38, Ville Voutilainen > <[email protected]> wrote: > > > > On Sun, 23 Aug 2026 at 22:26, Andrea Pinski > > <[email protected]> wrote: > > > > > > Sometimes the destructor will cause the optimizers not to see that > > > _M_engaged has been to set to false (e.g. an external call). This > > > means that we might get an uninitialized warning after the destructor > > > in some cases. > > > > Can you elaborate on what kind of an uninitialized warning that is, > > and what code triggers it? > > Never mind, I read the PR, that explains it.
..so yeah, we set _M_engaged to false before calling the destructor to make sure it's false even if the destructor does horrific things, like throws. Which we don't have to do. If a destructor of an element given to a stdlib facility throws, the user gets to keep both parts. I think the patch makes sense. I have no objections to it as written. I don't think I have objections to removing the pre-dtor clearing of _M_engaged either.
