971225-egcs and virtual inheritance : ill implemented feature?
Max Lawson
mlawson@drfmc.ceng.cea.fr
Fri Jan 16 01:51:00 GMT 1998
Hi,
I'm trying to use virtual inheritance on my i586-pc-linux-glibc1 box.
But the compilation abort cause the compiler is referring to a missing
default-ctor.
The testcase below shows the problem.
The workaround would be to define the default-ctor. But I would like to
avoid it :-(
Regards, Max
P.S. Is it easy to use the CVS system ?
// banane:$ g++ z.cc
// z.cc: In method `xxx::xxx(double)':
// z.cc:48: no matching function for call to `x00::x00 ()'
// z.cc:21: candidates are: x00::x00(const x00 &)
// z.cc:11: x00::x00(double)
class x00
{
public:
x00(double x) : x_(x) { }
virtual ~x00() { }
double val() const { return x_; }
protected:
double x_;
};
class x01
{
public:
x01( ) { }
virtual ~x01() { }
virtual void f() =0;
};
class x02 : public virtual x00, public x01
{
public:
x02(double x) : x00(x) { }
virtual ~x02() { }
};
class xxx : public x02
{
public:
xxx(double x) : x02(x) { }
~xxx() { }
void f( ) { }
};
xxx X(1);
int main( ) { }
More information about the Gcc
mailing list