This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]