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