c++/9740: Object included in another is not initialized properly

tron@eng.tau.ac.il tron@eng.tau.ac.il
Tue Feb 18 11:06:00 GMT 2003

>Number:         9740
>Category:       c++
>Synopsis:       Object included in another is not initialized properly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 18 11:06:01 UTC 2003
>Originator:     Eviatar Tron
>Release:        3.2.2
Configured with: ./configure
Thread model: posix
I have an object a of class A which has a memeber from another class B.

the A constructor includes a statment to zero it's memebrs
when the B constructor is called, it trashes the a object,
so that those members are not zero, but some random value.

compile the file using g++ -g 
when run, it prints the value of a.p at the
construction, and after the construction
I tried working with pointers as well, but didnt succeed

Content-Type: application/octet-stream; name="test.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cpp"


More information about the Gcc-bugs mailing list