This is the mail archive of the gcc-prs@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]

c++/566: g++-2.95.2: destructor not called



>Number:         566
>Category:       c++
>Synopsis:       g++-2.95.2: destructor not called
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 22 16:56:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Mark Hanson
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
RedHat Linux 6.2, Intel, SMP
>Description:
g++-2.95.2 doesn't call the destructor (V::~V()) for each
B::x.  The constructor is called for each X in the array,
and each can store distinct data, so there really are three
objects, but the destructor isn't called.  The calls only 
go as far down as A::~A().  I've searched the ARM and have
not found a reason why it wouldn't be called.  The
egcs-1.1.2 which comes with RH 6.2 calls the destructor for
each X.
>How-To-Repeat:
g++ -o foo foo.C
./foo
notice that V::~V() is not called for each X
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="foo.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foo.C"

I2luY2x1ZGUgPHN0ZGlvLmg+CgpjbGFzcyBWIHsKcHVibGljOgogICAgaW50ICppOwogICAgVjo6
VigpIHsgcHJpbnRmKCJWOjpWKClcbiIpOyBpID0gbmV3IGludDsgfQogICAgdmlydHVhbCBWOjp+
VigpIHsgcHJpbnRmKCJWOjp+VigpXG4iKTsgKmkgPSAwOyBkZWxldGUgaTsgfQp9OwoKY2xhc3Mg
QTogdmlydHVhbCBwdWJsaWMgViB7CnB1YmxpYzoKICAgIEE6OkEoKSB7IHByaW50ZigiQTo6QSgp
XG4iKTsgfQogICAgdmlydHVhbCBBOjp+QSgpIHsgcHJpbnRmKCJBOjp+QSgpXG4iKTsgfQp9OwoK
Y2xhc3MgWDogcHVibGljIEEgewpwdWJsaWM6CiAgICBYOjpYKCkgeyBwcmludGYoIlg6OlgoKVxu
Iik7IH0KICAgIFg6On5YKCkgeyBwcmludGYoIlg6On5YKClcbiIpOyB9Cn07CgpjbGFzcyBCOiBw
dWJsaWMgQSB7CnB1YmxpYzoKICAgIEI6OkIoKSB7IHByaW50ZigiQjo6QigpXG4iKTsgfQogICAg
Qjo6fkIoKSB7IHByaW50ZigiQjo6fkIoKVxuIik7IH0KfTsKCmNsYXNzIEM6IHB1YmxpYyBCIHsK
cHVibGljOgogICAgWCB4WzNdOwogICAgQzo6QygpIHsKCXByaW50ZigiQzo6QygpXG4iKTsKCSoo
eFswXS5pKSA9IDExMTExOwoJKih4WzFdLmkpID0gMjIyMjI7CgkqKHhbMl0uaSkgPSAzMzMzMzsK
ICAgIH0KICAgIEM6On5DKCkgeyBwcmludGYoIkM6On5DKClcbiIpOyB9Cn07CgppbnQKbWFpbigp
IHsKICAgIHByaW50ZigiQ29uc3RydWN0aW5nOlxuIik7CiAgICBDICpjOwogICAgaW50ICppWzNd
OwoKICAgIGMgPSBuZXcgQzsKICAgIGlbMF0gPSBjLT54WzBdLmk7CiAgICBpWzFdID0gYy0+eFsx
XS5pOwogICAgaVsyXSA9IGMtPnhbMl0uaTsKCiAgICBwcmludGYoIlxuRGVzdHJ1Y3Rpbmc6XG4i
KTsKICAgIGRlbGV0ZSBjOwoKICAgIC8vIGNvdWxkIGNyYXNoIGlmIHRoZSBWOjp+VigpIGlzIGFj
dHVhbGx5IGNhbGxlZC4uLgogICAgcHJpbnRmKCIlZFxuIiwgKihpWzBdKSk7CiAgICBwcmludGYo
IiVkXG4iLCAqKGlbMV0pKTsKICAgIHByaW50ZigiJWRcbiIsICooaVsyXSkpOwp9Cg==

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