This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13402] Wrong default value for uninitialized pointer-to-member
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Dec 2003 15:51:50 -0000
- Subject: [Bug c++/13402] Wrong default value for uninitialized pointer-to-member
- References: <20031215153219.13402.grigory@stl.sarov.ru>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2003-12-15 15:51 -------
The program has undefined semantics. By 12.1/5, the default constructor of
B initializes the pointer as if it was default initialized as if a user
specified constructor had an empty initializer list. 12.6.2/4 treats the
case of members not listed in the initializer list, and says that POD
types (e.g. pointers to members) are not initialized at all. I.e., the
given program has undefined behavior.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13402