From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18118 invoked by alias); 18 Feb 2003 11:06:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17987 invoked by uid 71); 18 Feb 2003 11:06:02 -0000 Resent-Date: 18 Feb 2003 11:06:02 -0000 Resent-Message-ID: <20030218110602.17983.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, tron@eng.tau.ac.il Received: (qmail 16965 invoked by uid 48); 18 Feb 2003 11:02:00 -0000 Message-Id: <20030218110200.16964.qmail@sources.redhat.com> Date: Tue, 18 Feb 2003 11:06:00 -0000 From: tron@eng.tau.ac.il Reply-To: tron@eng.tau.ac.il To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9740: Object included in another is not initialized properly X-SW-Source: 2003-02/txt/msg00799.txt.bz2 List-Id: >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 >Closed-Date: >Last-Modified: >Originator: Eviatar Tron >Release: 3.2.2 >Organization: >Environment: Configured with: ./configure Thread model: posix >Description: 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. >How-To-Repeat: compile the file using g++ -g when run, it prints the value of a.p at the construction, and after the construction >Fix: I tried working with pointers as well, but didnt succeed >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="test.cpp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.cpp" I2luY2x1ZGUgPGlvc3RyZWFtLmg+CgpjbGFzcyBBIHsKICBpbnQgaTsKICBpbnQgcDsKcHVibGlj OgogIEEoKSB7QSgwKTsgfTsKICBBKGludCBqKSB7aT1qOyBwPTA7IGNvdXQgPDwgImluIEEgY29u c3R1Y3RvcjpcbnA9IiA8PCBwIDw8IGVuZGw7fTsKICBpbnQgZ2V0cCgpIHsgcmV0dXJuIHA7IH07 Cn07CgpjbGFzcyBCIHsKCiAgaW50IHgseSx6OwogIEEgYTsKcHVibGljOgogIEIoKSB7IHg9MTsg eT0yOyB6PTM7IH0KICBCKGludCBwLGludCBxLCBpbnQgdCkgeyB4PXA7IHk9cTsgej10OyB9Owog IGludCBydW4oKSB7IGNvdXQgPDwgImFmdGVyIGNyZWF0aW9uOlxucD0iIDw8IGEuZ2V0cCgpIDw8 ZW5kbDt9OyAKfTsKICAKCm1haW4oKQp7CiAgQiBiMTsKICBiMS5ydW4oKTsKICAgIAp9Cg==