pure virtual destructor declared inline

Neil Booth neil@daikokuya.co.uk
Fri Nov 22 13:17:00 GMT 2002


Richard Smith wrote:-

> Hi,
> 
> g++ 2.95.4 chokes on the following:
> 
> class foo
> {
>   virtual ~foo() = 0 {}
> };
> 
> although it's valid C++, as far as I can tell. This is known to work on MSVC++ 
> version 6's compiler.
> 
> I'm running a stock install from Debian's unstable (sid) distro.
> The error given is:
> test.cpp:3: parse error before `{'
> 
> Is this a compiler bug?

No, C++ requires a ; not {}.  Inconsistent, yes.

Neil.



More information about the Gcc-bugs mailing list