This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: GCC3.0-release and multiple inheritance
Kalvinder Singh wrote:
>
> Hi Nathan,
>
> You might want to have a look at this bug as well. Just in case it is
> related. It is reproducable on an i686 machine.
>
> http://gcc.gnu.org/ml/gcc-bugs/2001-08/msg00081.html
This appears to be a different problem. I've reduced it down to the attached.
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. Please file a gnats bug report.
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
#include <stdio.h>
class C
{
int m;
public:
C() {printf ("ctor %s %p\n", __PRETTY_FUNCTION__, (void *)this);};
~C() {printf ("dtor %s %p\n", __PRETTY_FUNCTION__, (void *)this);};
};
void Foo (C c) {printf ("in Foo %p\n", (void *)&c);}
int main(int argc, char *argv[])
{
C c;
printf ("Before Foo in main \n");
Foo (c);
printf ("After Foo in main \n");
return 1;
}