Polymorphism occurs because of dynamic binding, which is made possible through use of pointers (The compiler internally represents a virtual function as a pointer, whose value is determined at run time) -
however, a static function is just that - its not a function pointer, but an object which has a static address.
If you want to call a derived class static function through a base class pointer, then you can use a non-static virtual function wrapper to achieve the same thing. eg,
#include <iostream>
class Base
{
static void foo() { std::cout << "Base\n"; }
public:
virtual void bar() { foo(); }
};
class Derived : public Base
{
static void foo() { std::cout << "Derived\n"; }
public:
virtual void bar() { foo(); }
};
int main()
{
Base* obj = new Derived;
obj->bar();
delete obj;
}