class Temp { private: ~Temp() {} friend class Final; }; class Final : virtual public Temp { public: void fun() { cout<<\"In base\";
The derived class does not call the private destructor of the base class, hence it does not need visibility.
Make your constructors private and only provide a static generator function.