https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109235
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Teis Johansen from comment #0) > I have tried implementing std::experimental::scope_exit N.B. this is already present in the upcoming GCC 13: https://gcc.gnu.org/gcc-13/changes.html#libstdcxx