[Bug c++/80635] std::optional and bogus -Wmaybe-uninitialized warning

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 5 07:38:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
If you mark "get" as noexcept, the warning disappears. If get throws an
exception, you can very well end up running the destructor without having
initialized the members. The warning seems correct to me.


More information about the Gcc-bugs mailing list