Quote from Nathan Sidwell
in main, we copy construct two C objects during the call to Foo.
Foo gets one of these by value, which is dtor'd in Foo. upon return
we dtor the other one. I think this is a problem with the pass-by-value
ABI method. It does look like a bug.
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/specs
Configured with: ../configure
Thread model: single
gcc version 3.0
Compile and run the attached program
State-Changed-Why: Confirmed as a horrible bug in GCC-3.0. A regression over 2.95
State-Changed-Why: Fixed for 3.1 by
PR c++/3948 -- C++ ABI change, followup to 2001-12-18 patch.
* class.c (finish_struct_bits): Also set TREE_ADDRESSABLE for a
type with a nontrivial destructor.