public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96121] New: Uninitialized variable copying not diagnosed
@ 2020-07-08 16:10 antoshkka at gmail dot com
  2020-07-08 16:12 ` [Bug c++/96121] " redi at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: antoshkka at gmail dot com @ 2020-07-08 16:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96121
           Summary: Uninitialized variable copying not diagnosed
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antoshkka at gmail dot com
  Target Milestone: ---

Consider the example:

struct A { A(); };
struct B { B(A); };

struct composed2 {
    B b_;
    A a_;
    composed2() : b_(a_)  {}
};


GCC does not diagnose the uninitialized variable `a_` usage with -Wall and
-Wextra. Some other compiler do diagnose:

warning: field 'a_' is uninitialized when used here [-Wuninitialized]
    composed2() : b_(a_)  {}
                     ^

Godbolt playground: https://godbolt.org/z/AbqzjR

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

end of thread, other threads:[~2021-11-19  3:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 16:10 [Bug c++/96121] New: Uninitialized variable copying not diagnosed antoshkka at gmail dot com
2020-07-08 16:12 ` [Bug c++/96121] " redi at gcc dot gnu.org
2020-07-08 16:24 ` glisse at gcc dot gnu.org
2020-07-08 16:27 ` glisse at gcc dot gnu.org
2020-07-08 16:29 ` antoshkka at gmail dot com
2020-07-08 16:55 ` glisse at gcc dot gnu.org
2020-07-13 12:08 ` manu at gcc dot gnu.org
2020-11-13  3:07 ` [Bug c++/96121] Uninitialized variable copying in member initialized list " mpolacek at gcc dot gnu.org
2021-11-19  3:38 ` cvs-commit at gcc dot gnu.org
2021-11-19  3:54 ` mpolacek at gcc dot gnu.org
2021-11-19  3:54 ` mpolacek 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).