Let's consider this example.
//some class members....
StaticlyManagedObject _staticlyManagedObject; //is this still allocated at the stack?
DynamiclyManagedObject * _dynamiclyManagedObject; //will be allocated in the heap.
_dynamiclyManagedObject = new DynamiclyManagedObject();
A subobject has the same storage duration as the complete object it is a part of. If an instance of
DynamiclyManagedObject is dynamically allocated, then the
StaticlyManagedObject member will be destroyed when the
DynamiclyManagedObject is destroyed.
Informally, you might say that the subobject will be on the heap if and only if the complete object is on the heap. However, storage duration is the technically correct way to talk about it; heap and stack are implementation details.