Bug in abstract methods in destructors

Benjamin Forgeau forgeau@tu-harburg.de
Thu Nov 4 09:26:00 GMT 1999


	Hi,

	I´m using a lot of abstract methods, and it seems that egcs interprets
such methods as elsewhere implemented when they are called from the
destructor. I tried to compile the following program with egcs-2.91.66:

//------------------------------------------
// Test abstract function in destructor

class A
{
public:
  A(){}
  ~A(){abstract_method();}

  virtual void abstract_method() = 0;
};

class B : public A
{
public:
  B(){}
  void abstract_method(){};
};

main()
{

  B b;
}                     
//-----------------------------

error message:
-------------

/tmp/ccn2EMMq.o: In function `A::~A(void)':
/tmp/ccn2EMMq.o(.gnu.linkonce.t._._1A+0x13): undefined reference to
`A::abstract_method(void)'
collect2: ld returned 1 exit status


	I do not see any understandable reason why it does not work.

	regards

		ben	


¸¸,ø¤º°``°º¤ø,¸¸,ø¤º°``°º¤ø,¸¸,ø¤º°``°º¤ø,¸¸,ø¤º°``°º¤ø,¸¸,ø¤º°``°º¤ø,¸¸

Benjamin Forgeau                 Raum 3032, Denickestr 17, 21073 Hamburg
Technische Universitaet          Tel. +4940 42878 3485   Fax 42878 2941
  Hamburg-Harburg                mailto:forgeau@tu-harburg.de
Elektrotechnik VI                http://www.tu-harburg.de/et6
Digitale Kommunikationssysteme
FSP 4-06, 21071 Hamburg, Germany

``°º¤ø,¸¸,ø¤º°``°º¤ø,¸¸,ø¤º°``°º¤ø,¸¸,ø¤º°``°º¤ø,¸¸,ø¤º°``°º¤ø,¸¸,ø¤º°``


More information about the Gcc-bugs mailing list