Here's an example to illustrate my issue :
class Foo1
{
virtual void FooMethod() __attribute__((deprecated)) = 0;
};
class Foo2 : public Foo1
{
virtual void FooMethod() = 0;
};
My class Foo1
has a pure virtual method FooMethod
. I don't want user to use it anymore. I want to make them use this method in the inherited class Foo2
.
Foo1::FooMethod()
is so deprecated and put in Foo2
: Foo2::FooMethod()
. Foo2::FooMethod()
is then an override of Foo1::FooMethod();
If the user try to overload Foo1::FooMethod()
, he will get a compilation warning.
My issue is, if the user override Foo2::FooMethod()
, he also gets a warning.
How can I implement "Overload Foo1::FooMethod()
is deprecated, you must override FooMethod()
through Foo2
". I can't delete Foo1::FooMethod()
for compatibility.
Thanks !