From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7A468385841A; Tue, 30 Aug 2022 17:11:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A468385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661879483; bh=sUpJo4+2JUGxXflwceW3EoZlTusPE/C0crCkcguS1V4=; h=From:To:Subject:Date:From; b=bXBoVLWlZWRIa5K84hlsKDk8ZAN/vXGZZnbV6Nbqo27vQPO6KcIJmCt5xMsIAP9Gs t+fc+0SQzo89w1w9A4ow0W96MCAfBBL2bu8kT2k0ZRSWC+pdqOg1ao9z3hnjPk6ila oAc4wZgoWSnNvC6d0L3OIvn5JzD+K1IMQ71psE1w= From: "vincent.lextrait at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/106780] New: gcc maybe-uninitialized warning on std_function.h Date: Tue, 30 Aug 2022 17:11:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vincent.lextrait at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106780 Bug ID: 106780 Summary: gcc maybe-uninitialized warning on std_function.h Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: vincent.lextrait at gmail dot com Target Milestone: --- Maybe not the right place to report this bug. Apologies in advance if it is not. I am using the ready-made gcc-12.1.0_1 version of gcc-12.1.0 downloaded with brew on a Mac. The compilation flags are -Wall -Wextra -pedantic-errors. gcc warns when including the regex header: In constructor 'std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res =3D bool; _ArgTypes =3D {char}]', inlined from 'std::__detail::_State<_Char_type>::_State(std::__detail::_State<_Char_type= >&&) [with _Char_type =3D char]' at /usr/local/Cellar/gcc@12/12.1.0_1/include/c++/12/bits/regex_automaton.h:149= :4, inlined from 'std::__detail::_State<_Char_type>::_State(std::__detail::_State<_Char_type= >&&) [with _Char_type =3D char]' at /usr/local/Cellar/gcc@12/12.1.0_1/include/c++/12/bits/regex_automaton.h:146= :7, inlined from 'std::__detail::_StateIdT std::__detail::_NFA<_TraitsT>::_M_insert_subexpr_end() [with _TraitsT =3D std::__cxx11::regex_traits]' at /usr/local/Cellar/gcc@12/12.1.0_1/include/c++/12/bits/regex_automaton.h:290= :24: /usr/local/Cellar/gcc@12/12.1.0_1/include/c++/12/bits/std_function.h:405:42: warning: '*(std::function*)((char*)&__tmp + offsetof(std::__detail::_StateT, std::__detail::_State::.std::__detail::_State_base::)).std::function::_M_invoker' may be used uninitialized [-Wmaybe-uninitialized] 405 | : _Function_base(), _M_invoker(__x._M_invoker) | ~~~~^~~~~~~~~~=