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

--- Comment #7 from Ivan Sorokin <vanyacpp at gmail dot com> ---
(In reply to Jonathan Wakely from comment #6)

> +       // The following seems redundant but improves codegen, see PR 112480.
> +       if constexpr (is_trivially_destructible_v<_Tp>)
> +         this->_M_engaged = false;
>        }


In theory non-trivial destructors that are optimizible to no-op can also
benefit from the same optimization.

I don't know how often non-trivial no-op destructors occur in practice. Perhaps
we can ignore such case.

Reply via email to