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++/13402] New: Wrong default value for uninitialized pointer-to-member


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


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