The error message seems to be little mis-leading with the scenario, when we try to delete a virtual method.
prog.cpp:4:16: error: deleted function 'virtual void Test::foo()'
prog.cpp:8:2: error: used here
Code
struct Test : public Base
{
Test() {}
virtual void foo () = delete; // error
};
Are virtual method not deleteable for the same reason, why they cannot remain unimplemented in C++03 ? Is there any way to mention that Test purposely not implementing virtual foo() ?
The term use has a concrete definition in the standard, and in particular for virtual functions the definition of odr-used is:
Where odr-used is a new term in the upcoming standard that refers to what the previous standard called plainly used:
My take is that the error message employs the term used to refer to odr-used in this particular case, and yes, the reason why this is a violation is exactly the same reason by which you cannot leave a non-pure virtual member function unimplemented.