public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26100] New: Destructor called twice
@ 2006-02-05 6:20 igodard at pacbell dot net
2006-02-05 6:21 ` [Bug c++/26100] " igodard at pacbell dot net
2006-02-05 12:26 ` rguenth at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: igodard at pacbell dot net @ 2006-02-05 6:20 UTC (permalink / raw)
To: gcc-bugs
The attached code does various things with a type ("inv") that increments a
count on constructor calls and decrements on destructor calls. As there are no
declarations of this type, only temporaries, the net should be zero at the end
of each statement. Unfortunately, the count goes negative.
Ivan
--
Summary: Destructor called twice
Product: gcc
Version: 3.4.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26100
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/26100] Destructor called twice
2006-02-05 6:20 [Bug c++/26100] New: Destructor called twice igodard at pacbell dot net
@ 2006-02-05 6:21 ` igodard at pacbell dot net
2006-02-05 12:26 ` rguenth at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: igodard at pacbell dot net @ 2006-02-05 6:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from igodard at pacbell dot net 2006-02-05 06:21 -------
Created an attachment (id=10780)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10780&action=view)
source code
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26100
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/26100] Destructor called twice
2006-02-05 6:20 [Bug c++/26100] New: Destructor called twice igodard at pacbell dot net
2006-02-05 6:21 ` [Bug c++/26100] " igodard at pacbell dot net
@ 2006-02-05 12:26 ` rguenth at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-05 12:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2006-02-05 12:26 -------
You are missing copy constructor invocations. Add
inv(const inv&) { ++count; }
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26100
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-02-05 12:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-05 6:20 [Bug c++/26100] New: Destructor called twice igodard at pacbell dot net
2006-02-05 6:21 ` [Bug c++/26100] " igodard at pacbell dot net
2006-02-05 12:26 ` rguenth at gcc dot gnu dot org
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).