https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121329
Bug ID: 121329
Summary: There are some errors about std::nullopt
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: q1210081098 at gmail dot com
Target Milestone: ---
I wrote a code hoping to use the max_element function to get the maximum value
in a vector and return it.
https://gcc.godbolt.org/z/19nr6hP5x
You can see that a bug occurred, but when I removed the processing of null
values, the bug disappeared
https://gcc.godbolt.org/z/esEbWKMG8
std::nullopt may cause this problem