public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4871: value argument destructor called twice when a virtual method is called in virtual inherited class
@ 2002-04-09 10:16 jason
  0 siblings, 0 replies; 3+ messages in thread
From: jason @ 2002-04-09 10:16 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jamie, nobody

Synopsis: value argument destructor called twice when a virtual method is called in virtual inherited class

State-Changed-From-To: open->feedback
State-Changed-By: jason
State-Changed-When: Tue Apr  9 10:16:33 2002
State-Changed-Why:
    I can't reproduce this with 3.0.4 or the current 3.1 branch; looks like it's been fixed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4871


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c++/4871: value argument destructor called twice when a virtual method is called in virtual inherited class
@ 2002-12-07 13:54 reichelt
  0 siblings, 0 replies; 3+ messages in thread
From: reichelt @ 2002-12-07 13:54 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jamie, nobody

Synopsis: value argument destructor called twice when a virtual method is called in virtual inherited class

State-Changed-From-To: feedback->closed
State-Changed-By: reichelt
State-Changed-When: Sat Dec  7 13:53:58 2002
State-Changed-Why:
    Seems to be fixed.
    I checked gcc 3.0.4, 3.2.1 and mainline (3.3-20021118)

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4871


^ permalink raw reply	[flat|nested] 3+ messages in thread

* c++/4871: value argument destructor called twice when a virtual method is called in virtual inherited class
@ 2001-11-02  8:08 jamie
  0 siblings, 0 replies; 3+ messages in thread
From: jamie @ 2001-11-02  8:08 UTC (permalink / raw)
  To: gcc-gnats


>Number:         4871
>Category:       c++
>Synopsis:       value argument destructor called twice when a virtual method is called in virtual inherited class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 13 18:26:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jamie Painter <jamie@turboabs.com:>
>Release:        gcc version 3.0.2
>Organization:
>Environment:
Linux
>Description:
When a method is called with a class argument passed by value, under certain conditions the value is destructed twice.  The conditions seem to be related to the use of virtual inheritance, as demonstrated in the attached source.

>How-To-Repeat:
Compile (g++ gccbug.cpp), 
run (./a.out).

Observe the output:

constructing  ValueType 0xbffffa34
destructing   ValueType 0xbffffa34
destructing   ValueType 0xbffffa34

Note that the value parameter is constructed once and deconstructed twice.

Gcc 2.95.2 produces the correct output:

constructing  ValueType 0xbffff8a4
destructing   ValueType 0xbffff8a4

>Fix:

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

I2luY2x1ZGUgPGlvc3RyZWFtPgoKc3RydWN0IFZhbHVlVHlwZQp7CiAgVmFsdWVUeXBlKCkgIAog
IHsgCiAgICBzdGQ6OmNlcnIgPDwgImNvbnN0cnVjdGluZyAgVmFsdWVUeXBlICIgPDwgdGhpcyA8
PCBzdGQ6OmVuZGw7IAogIH0KICB+VmFsdWVUeXBlKCkgCiAgeyAKICAgIHN0ZDo6Y2VyciA8PCAi
ZGVzdHJ1Y3RpbmcgICBWYWx1ZVR5cGUgIiA8PCB0aGlzIDw8IHN0ZDo6ZW5kbDsgCiAgfQogIFZh
bHVlVHlwZShjb25zdCBWYWx1ZVR5cGUgJnYpCiAgewogICAgc3RkOjpjZXJyIDw8ICJjb3B5IGNv
bnN0cnVjdCBWYWx1ZVR5cGUgIiAKCSAgICAgIDw8IHRoaXMgPDwgIiBzcmM6ICIgPDwgJnYgIDw8
IHN0ZDo6ZW5kbDsKICB9Cn07CgpzdHJ1Y3QgQmFzZSAKewogIHZpcnR1YWwgfkJhc2UoKSB7fQog
IHZpcnR1YWwgdm9pZCBieVZhbHVlQ2FsbCggVmFsdWVUeXBlICkgPSAwOwp9OwoKc3RydWN0IERl
cml2ZWQgOiBwdWJsaWMgdmlydHVhbCBCYXNlIAp7CiAgdmlydHVhbCB+RGVyaXZlZCgpIHt9Cn07
CgpzdHJ1Y3QgQmFzZURlZiA6IHB1YmxpYyB2aXJ0dWFsIEJhc2UgCnsKICB2aXJ0dWFsIH5CYXNl
RGVmKCkge30KICB2b2lkIGJ5VmFsdWVDYWxsKCBWYWx1ZVR5cGUgKTsKfTsKCnN0cnVjdCBEZXJp
dmVkRGVmIDogcHVibGljIERlcml2ZWQsIHB1YmxpYyBCYXNlRGVmIAp7Cn07Cgp2b2lkIEJhc2VE
ZWY6OmJ5VmFsdWVDYWxsKCBWYWx1ZVR5cGUgdikKewp9CgoKaW50IG1haW4oaW50IGFyZ2MsIGNo
YXIgKmFyZ3ZbXSkKewogIEJhc2UgKmIgPSBuZXcgRGVyaXZlZERlZjsKICBiLT5ieVZhbHVlQ2Fs
bCggVmFsdWVUeXBlKCkgKTsKICByZXR1cm4gMDsKfQoK


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-12-07 21:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-09 10:16 c++/4871: value argument destructor called twice when a virtual method is called in virtual inherited class jason
  -- strict thread matches above, loose matches on Subject: below --
2002-12-07 13:54 reichelt
2001-11-02  8:08 jamie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).