This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++ copy constructor bug
- To: bhudson at ptolemy dot arc dot nasa dot gov
- Subject: Re: c++ copy constructor bug
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sat, 27 May 2000 22:19:56 +0200
- CC: bug-gcc at gnu dot org
- References: <20000524120503.A6057@obelix.arc.nasa.gov>
> 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