Mail Archives: djgpp/2002/05/24/06:45:55
Hi,
I'm having trouble compiling the code below with GCC v3.1
under DJGPP. I currently have no other systems available
(with v3.1) so I would like to ask DJGPP folks first before
posting this on a GCC mailing list.
The code compiles nicely with all other versions of GCC I have
here (2.95.2, 2.95.3 3.0.2, 3.0.3, 3.0.4).
I'm not so fluent with the C++ standard, so there might be something
wrong with the code. The code given here doesn't actually do
anything useful, but this is more or less the shortest example
that shows this problem which I got out of a much more complex
program.
Any ideas welcome.
Regards,
Tony
a.cpp: In copy constructor `QQ::QQ(const QQ&)':
a.cpp:57: invalid conversion from `const RR*' to `long long int'
a.cpp:57: initializing argument 1 of `RR::RR(long long int)'
a.cpp: In function `int main()':
a.cpp:57: initializing temporary from result of `QQ::QQ(const RR&)'
// begin test code
class QQ;
class RR
{
public:
short xx;
RR(const long long i);
RR();
RR(const RR& f);
~RR();
};
class QQ
{
public:
RR yy[4][4];
QQ();
QQ(const RR& f);
~QQ();
};
inline RR::RR(const long long i)
{
yy = (short)i;
}
inline RR::RR() {yy = 0;}
inline RR::RR(const RR& f) {yy = f.xx;}
inline RR::~RR() {}
inline QQ::QQ()
{
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
yy[i][j] = 0;
}
}
}
inline QQ::QQ(const RR &f)
{
for(int i=0;i<4;i++)
{
for(int j=0;j<4;j++)
{
yy[i][j] = f;
}
}
}
inline QQ::~QQ(){}
int main()
{
QQ x = RR(123);
QQ *y = &x;
QQ z = *y;
return x.yy[3][3].xx;
}
// End test code
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
- Raw text -