From: dmurphy@motie.zko.dec.com (Dennis Murphy)
Subject: Re: DEC cxx bug (default copy operator and virtual inheritance)
Date: 1995/08/16 [thread overview]
Message-ID: <40t1ob$6ju@nntpd.lkg.dec.com> (raw)
In-Reply-To: JLM.95Aug4125839@ludo.two-oo-one.fr
>Here is a bug in default copy operator and virtual inheritance in
>DEC C++ V5.0-3 for DEC OSF/1 (Alpha)
I took a look at this problem and I'm entering a bug report related to
it. The problem is not the constructor but rather appears to be an
invalid size for objects of class B.
Here's an example...
motie.zko.dec.com> cxx newsbug1_size.C
motie.zko.dec.com> tail newsbug1_size.C
<< (char*)&c.a_ - (char*)&c << endl;
}
void main ()
{
cout << "class A size : " << sizeof(A) << endl;
cout << "class B size : " << sizeof(B) << endl;
cout << "class C size : " << sizeof(C) << endl;
}
motie.zko.dec.com> a.out
class A size : 4
class B size : 24
class C size : 24
motie.zko.dec.com>
If class B has a size of 24 class C objects may not be of size 24
also as class C defines an additional data member that's destroyed
in the copy of b to c.
I don't have a workaround other than those you've observed.
Dennis Murphy
next prev parent reply other threads:[~1995-08-16 4:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-08-04 4:00 DEC cxx bug (default copy operator and virtual inheritance) Jean-Louis Moser
1995-08-16 4:00 ` Dennis Murphy [this message]
-- strict thread matches above, loose matches on Subject: below --
1995-08-04 4:00 Jean-Louis Moser
1995-08-07 4:00 ` Alec Habig
1995-08-14 4:00 ` Bill Kemp
1995-08-14 4:00 ` Andrew Gallatin
1995-08-15 4:00 ` Leo Bicknell
1995-08-15 4:00 ` Dan Pop
1995-08-15 4:00 ` Bill Kemp
1995-08-19 4:00 ` A.Schindler
1995-08-18 4:00 ` Alex Kowalenko
1995-08-20 4:00 ` Daniel S. Riley
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox