[Bug c++/70991] New: Uninitialized class allowed if it came from self-assignment, or a member function

appfault at hotmail dot com gcc-bugzilla@gcc.gnu.org
Sat May 7 03:51:00 GMT 2016


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

            Bug ID: 70991
           Summary: Uninitialized class allowed if it came from
                    self-assignment, or a member function
           Product: gcc
           Version: 5.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: appfault at hotmail dot com
  Target Milestone: ---

g++ allows uninitialized class to be used for member variables (hitting
uninitialized memory), if the class was declared as an assignment to itself.

It's not clear whether this violates the C++ standard (it sure seems like it
would), but at the very least compiling with `g++ -Wall -Wextra test.cpp`
should generate a warning.


More information about the Gcc-bugs mailing list