https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109941
--- Comment #2 from Roy Jacobson <roi.jacobson1 at gmail dot com> --- Right, libc++ do that as well since 2019 - https://reviews.llvm.org/D65900?id=213975. Although with the RAII classes I think you need to [[nodiscard]] the constructor which I think (?) is a compiler extension. And you're also much less likely to have false positives with that so you can actually do that unconditionally :)