When a derived class object is constructed, the anonymous base class sub-object is constructed first. And when it is destroyed, the anonymous base class sub-object is destroyed at the end.
The destructor for A ought to be virtual; or else delete a ; won't destroy B.