CPPCheck warns here about returning a pointer to an already-invalid object. As far as I can see the thing is that std::unique_ptr<Cell>(cells) deletes the cells when the pointer stops to exist. Then we no more mention that pointer and CPPCheck doesn't know that base_DynamicAppend moves the pointer to a list, which means the pointer lives on even if this function exits.
This function is deprecated. It is provided temporarily to support porting to unique_ptr-based Cell ownership. It should be removed after the porting is done.
We check here if the recalc start is within the worksheet. Would it make more sense to store the recalculation start in a CellPointer that automagically zeroes itself if that isn't the case?
I have deactivated this assert for the release as it scares the users in a case we don't seem to have a problem. But we perhaps should try to find out why it is triggered.