c++ copy constructor bug

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sat May 27 13:23:00 GMT 2000


> I've reduced the problem to what's in the attached files.  To get the bug,
> leave in the copy constructor for mystruct.  To avoid it, remove the copy
> constructor.

Thanks for your bug report. This is not a bug in the compiler, but in
your code. You use different definitions of the class for C and for
C++, so you cannot expect interworking.

Interworking is only guaranteed for POD class types (i.e. those
without base classes, virtual members, reference members,
constructors, etc). In your specific example, the calling convention
for a structure changes when a copy constructor is added.

Regards,
Martin


More information about the Gcc-bugs mailing list