Consider the following:
In X.h:
class X
{
X();
virtual ~X();
};
X.cpp:
#inclu
You may be getting away with this because both constr and destr are private - if there is no other ref to class X in your build then the compiler may be deducing that the destr is not required, so lack of a definition is no biggie.
This does not explain to me why case 1 fails while 2 and 3 build OK though. Wonder what happens if both are made public?