https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109235
--- Comment #6 from Jonathan Wakely ---
(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#libstdcx
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109235
Andrew Pinski changed:
What|Removed |Added
Resolution|--- |DUPLICATE
Status|NEW
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109235
--- Comment #4 from Andrew Pinski ---
(In reply to Andrew Pinski from comment #3)
> If we move the nodiscard to the constructor, GCC errors out correctly.
That is true even on the original testcase.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109235
Andrew Pinski changed:
What|Removed |Added
Summary|nodiscard attribute ignored |nodiscard attribute on