There are good reasons for constructing the base class interface with all virtual functions as private or protected (see this). But then how does one prevent the derived cla
it would make sense that the compiler would warn about such usage.
Why would it? It's up to each class's designer to decide about its external interface.
In C++, a base class has no special power to enforce derived class interface properties. The derived class could decide to make some overriding function private when the base function is public, or vice versa. The interface of the derived class is a contract with its clients, not with the base class (unless the base class is a client of the derived class, as with a curiously recurring template base class).