public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/106780] New: gcc maybe-uninitialized warning on std_function.h
@ 2022-08-30 17:11 vincent.lextrait at gmail dot com
  2022-08-31  7:06 ` [Bug libstdc++/106780] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vincent.lextrait at gmail dot com @ 2022-08-30 17:11 UTC (permalink / raw)
  To: gcc-bugs

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

            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 = bool;
_ArgTypes = {char}]',
    inlined from
'std::__detail::_State<_Char_type>::_State(std::__detail::_State<_Char_type>&&)
[with _Char_type = 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 = 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 =
std::__cxx11::regex_traits<char>]' 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<bool(char)>*)((char*)&__tmp +
offsetof(std::__detail::_StateT,
std::__detail::_State<char>::<unnamed>.std::__detail::_State_base::<unnamed>)).std::function<bool(char)>::_M_invoker'
may be used uninitialized [-Wmaybe-uninitialized]
  405 |       : _Function_base(), _M_invoker(__x._M_invoker)
      |                                      ~~~~^~~~~~~~~~

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/106780] gcc maybe-uninitialized warning on std_function.h
  2022-08-30 17:11 [Bug libstdc++/106780] New: gcc maybe-uninitialized warning on std_function.h vincent.lextrait at gmail dot com
@ 2022-08-31  7:06 ` rguenth at gcc dot gnu.org
  2022-08-31  8:22 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-31  7:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
> cat t.C
#include <regex>
> /space/rguenther/install/gcc-12.1/bin/g++ -S t.C -Wall -Wextra -pedantic-errors
<nothing>

I can't reproduce.  So can you provide a testcase?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/106780] gcc maybe-uninitialized warning on std_function.h
  2022-08-30 17:11 [Bug libstdc++/106780] New: gcc maybe-uninitialized warning on std_function.h vincent.lextrait at gmail dot com
  2022-08-31  7:06 ` [Bug libstdc++/106780] " rguenth at gcc dot gnu.org
@ 2022-08-31  8:22 ` marxin at gcc dot gnu.org
  2022-08-31 10:36 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-08-31  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-08-31
                 CC|                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/106780] gcc maybe-uninitialized warning on std_function.h
  2022-08-30 17:11 [Bug libstdc++/106780] New: gcc maybe-uninitialized warning on std_function.h vincent.lextrait at gmail dot com
  2022-08-31  7:06 ` [Bug libstdc++/106780] " rguenth at gcc dot gnu.org
  2022-08-31  8:22 ` marxin at gcc dot gnu.org
@ 2022-08-31 10:36 ` redi at gcc dot gnu.org
  2022-08-31 14:28 ` vincent.lextrait at gmail dot com
  2022-10-22  0:50 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2022-08-31 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Dup of PR 105562?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/106780] gcc maybe-uninitialized warning on std_function.h
  2022-08-30 17:11 [Bug libstdc++/106780] New: gcc maybe-uninitialized warning on std_function.h vincent.lextrait at gmail dot com
                   ` (2 preceding siblings ...)
  2022-08-31 10:36 ` redi at gcc dot gnu.org
@ 2022-08-31 14:28 ` vincent.lextrait at gmail dot com
  2022-10-22  0:50 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: vincent.lextrait at gmail dot com @ 2022-08-31 14:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Vincent <vincent.lextrait at gmail dot com> ---
Yes it seems safe to consider it a dupe.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/106780] gcc maybe-uninitialized warning on std_function.h
  2022-08-30 17:11 [Bug libstdc++/106780] New: gcc maybe-uninitialized warning on std_function.h vincent.lextrait at gmail dot com
                   ` (3 preceding siblings ...)
  2022-08-31 14:28 ` vincent.lextrait at gmail dot com
@ 2022-10-22  0:50 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-22  0:50 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---


*** This bug has been marked as a duplicate of bug 105562 ***

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-22  0:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 17:11 [Bug libstdc++/106780] New: gcc maybe-uninitialized warning on std_function.h vincent.lextrait at gmail dot com
2022-08-31  7:06 ` [Bug libstdc++/106780] " rguenth at gcc dot gnu.org
2022-08-31  8:22 ` marxin at gcc dot gnu.org
2022-08-31 10:36 ` redi at gcc dot gnu.org
2022-08-31 14:28 ` vincent.lextrait at gmail dot com
2022-10-22  0:50 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).