This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70991] New: Uninitialized class allowed if it came from self-assignment, or a member function
- From: "appfault at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 07 May 2016 03:51:08 +0000
- Subject: [Bug c++/70991] New: Uninitialized class allowed if it came from self-assignment, or a member function
- Auto-submitted: auto-generated
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.