This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/16115] [3.5 regression] problem with argument passing via temporary (breaks auto_ptr)
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jun 2004 16:55:32 -0000
- Subject: [Bug tree-optimization/16115] [3.5 regression] problem with argument passing via temporary (breaks auto_ptr)
- References: <20040621164318.16115.snyder@fnal.gov>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-06-21 16:55 -------
Confirmed. With this minimally modified testcase
------------------------
#include <memory>
struct A
{
A() { printf ("a ctor %x\n", this); }
A(const A&) { printf ("a copy ctor %x\n", this); }
~A() { printf ("a dtor %x\n", this); }
};
void foo (std::auto_ptr<A> a)
{
delete a.release();
}
int main ()
{
foo (std::auto_ptr<A> (new A));
}
-----------------------
we can also see that the copy constructor is not called, and that thus
the number of con- and destructor calls do not match -- bad...
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ x.cc -O2
g/x> ./a.out
a ctor 804a008
a dtor 804a008
a dtor 804a008
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2004-06-21 16:55:31
date| |
Summary|3.5: problem with argument |[3.5 regression] problem
|passing via temporary |with argument passing via
|(breaks auto_ptr) |temporary (breaks auto_ptr)
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16115