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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
<source>: In function 'void t(const std::string&)':
<source>:13:51: warning: '*(int*)((char*)&port +
offsetof(std::optional<int>,std::optional<int>::<unnamed>.std::_Optional_base<int,
true, true>::<unnamed>))' may be used uninitialized [-Wmaybe-uninitialized]
   13 |         reqb << "Host: " << port.value_or(443) << "\r\n";
      |                                                   ^~~~~~
<source>:9:28: note: '*(int*)((char*)&port +
offsetof(std::optional<int>,std::optional<int>::<unnamed>.std::_Optional_base<int,
true, true>::<unnamed>))' was declared here
    9 |         std::optional<int> port(i.length() > 0 ?
std::make_optional(std::strtol("99", nullptr, 10)) : std::nullopt);
      |                            ^~~~

Reply via email to