This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13402] New: Wrong default value for uninitialized pointer-to-member
- From: "grigory at stl dot sarov dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Dec 2003 15:32:26 -0000
- Subject: [Bug c++/13402] New: Wrong default value for uninitialized pointer-to-member
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
An uninitialized pointer to member field in a file-scope object must be NULL by
default (accordong to the C++ ABI NULL is represented as -1).
G++ compiler fails to provide correct default value for pointer to member field
of a base class. In the simple class hierarchy listed below, p1 is not NULL.
struct A {
int x;
};
struct B {
int A::*p1;
};
struct D : B {
};
D obj;
Complete run-time test attached.
--
Summary: Wrong default value for uninitialized pointer-to-member
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: grigory at stl dot sarov dot ru
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-redhat-linux
GCC host triplet: i686-redhat-linux
GCC target triplet: i686-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13402