I'm trying do declare pure virtual destructor, in VS2019 I'm writing like that:
virtual ~A() = 0 {};
and it's fine, but in Clion don't accept that I'm getting the following message:
pure-specifier on function-definition virtual ~A() = 0{ };
and it forces me to write a different implementation for the function (not that it to much trouble but id like to know why is that)
From the C++ 20 (11.6.3 Abstract classes)
- ...[Note: A function declaration cannot provide both a pure-specifier and a definition — end note] [Example:
struct C {
virtual void f() = 0 { }; // ill-formed
};
— end example]