This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c++ copy constructor bug


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]