gcc misses the access to the uninitialized member S::i in the program below
and fails to issue a warning for it.

I would expect to see a warning not only for the access to the member but
also for the definition of the user-defined constructor that fails to
initialize the data member.

$ cat t.cpp && gcc -Wuninitialized -Wall -Wextra -W -c t.cpp
int main () {
    struct S {
        int i;
        S() { }
    } s;

    return s.i;
}


-- 
           Summary: missing -Wuninitialized warning on a user-defined class
                    ctor
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: msebor at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42000

Reply via email to