[Bug c++/109235] nodiscard attribute on class not copied to the constructors

2023-03-22 Thread redi at gcc dot gnu.org via Gcc-bugs
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

[Bug c++/109235] nodiscard attribute on class not copied to the constructors

2023-03-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109235 Andrew Pinski changed: What|Removed |Added Resolution|--- |DUPLICATE Status|NEW

[Bug c++/109235] nodiscard attribute on class not copied to the constructors

2023-03-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
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.

[Bug c++/109235] nodiscard attribute on class not copied to the constructors

2023-03-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109235 Andrew Pinski changed: What|Removed |Added Summary|nodiscard attribute ignored |nodiscard attribute on