[gnu.g++.bug] g++ compiler problem - virtual fns with derived class args

T.Day@PURPLE.CS.UCL.AC.UK (Tim Day) (02/24/89)

Here's a good 'un.... It compiles OK under Glockenspiel C++, but under
g++ (g++ version 1.32.0) I get :

vtest.cc:17: conficting specification deriving from virtual
  function `void One::scooby (struct Foo &)'
vtest.cc:27: warning: excess elements in aggregate initializer
--------------------------------------------------------------
class Foo
{
public:
	Foo()	{}
};

class Bar : public Foo
{
public:
	Bar()	:(){}
};

class One
{
public:
	One()				{}
	virtual void scooby(Foo&)	{}		// Here
	virtual void scooby(Bar&)	{}
};

class Two : public One
{
public:
	Two()				:(){}
	virtual void scooby(Foo&)	{}
	virtual void scooby(Bar&)	{}
};							// and here

main()
{	One a;Two b;
	a.scooby(Foo());a.scooby(Bar());b.scooby(Bar());b.scooby(Foo());
	exit(0);
}
-----------------------------------------------------------------
The problem goes away if class Bar is NOT derived from class Foo.

Tim