If I create a very simple class like this :
class A
{
public :
virtual void foo()
{
}
};
(no virtual destructor) is the compiler going to create vtable? Or are modern compilers smart enough to recognize this case (which might be a bad copy and paste) and not add virtual table for such classes?
The v-table is an implementation detail. Compilers that use v-tables for virtual functions will create one for this class. Those that don't, won't.