[Bug c++/25826] New: pure virtual destructors accepted by GCC, but cause link failure

2006-01-17 Thread lloyd at randombit dot net
The following code: class A { public: virtual ~A() = 0; }; class B : public A { public: ~B() {} }; int main() { B b; } compiles with GCC 4.0.2 (clean with -ansi -Wall -Wextra) but does not link due to an undefined reference to ~A(). Herb Sutter claims

Re: [Bug c++/25826] New: pure virtual destructors accepted by GCC, but cause link failure

2006-01-17 Thread Gabriel Dos Reis
lloyd at randombit dot net [EMAIL PROTECTED] writes: | The following code: | | class A |{ |public: | virtual ~A() = 0; You still need to *define* the destructor. See ยง12.4/7. -- Gaby