https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119197
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <[email protected]>: https://gcc.gnu.org/g:300f170835d3d34c22c1c15dfb8df42aa5ebebff commit r16-7875-g300f170835d3d34c22c1c15dfb8df42aa5ebebff Author: Arthur O'Dwyer <[email protected]> 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<void, E>): Add [[nodiscard]] to class. * testsuite/20_util/expected/119197.cc: New test. Signed-off-by: Arthur O'Dwyer <[email protected]> Reviewed-by: Nathan Myers <[email protected]>
