[Bug libstdc++/119197] [feat req] `std::expected` should be nodiscard

2026-03-03 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119197

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|--- |16.0
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Jonathan Wakely  ---
Fixed for GCC 16

[Bug libstdc++/119197] [feat req] `std::expected` should be nodiscard

2026-03-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119197

--- Comment #1 from GCC Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:300f170835d3d34c22c1c15dfb8df42aa5ebebff

commit r16-7875-g300f170835d3d34c22c1c15dfb8df42aa5ebebff
Author: Arthur O'Dwyer 
Date:   Mon Mar 2 10:59:29 2026 -0500

libstdc++: Make `std::expected` nodiscard [PR119197]

The new test includes two lines that currently do not warn because of
GCC compiler bug PR85973; the lines that do warn are the more
important cases.

PR libstdc++/119197

libstdc++-v3/ChangeLog:

* include/std/expected (expected, expected): Add
[[nodiscard]] to class.
* testsuite/20_util/expected/119197.cc: New test.

Signed-off-by: Arthur O'Dwyer 
Reviewed-by: Nathan Myers 

[Bug libstdc++/119197] [feat req] `std::expected` should be nodiscard

2025-03-10 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119197

Jonathan Wakely  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2025-03-10