Pull Request №764 RosettaCommons/rosetta/main ← lyskov-ai/rosetta/fix/copy-ctor-drops-members
Merge: 0c38201cdcd83a9217d947a1604b4317f71c6831←fa272981f0b7f34f0077366e934d22a728d299f2
Copy missing data members in hand-written copy ctors / assignment operators
----------------
Merge commit message:
Copy missing data members in hand-written copy ctors / assignment operators
A sweep of hand-written copy constructors and copy-assignment operators
turned up 30 classes that copy most of their data members but silently
skip one or two. In each case the skipped member is configuration that
the object is expected to carry with it, not a cache or scratch state,
so the copy (usually produced by clone()) behaves differently from the
original.
Several of the skipped members have no default member initializer, so
the copy left them indeterminate rather than merely stale --
MembraneInfo::membrane_core_, BestHotspotCstMover::cb_force_constant_,
SSElementLengthFilter::threshold_, RRComparer*::absolute_threshold_,
RotamerRecovery::ignore_unrecognized_res_, CircularPermutation::ignore_chain_,
MPDockingMover::jump_num_ and SizeInSegmentsRequirement::size_.
BondedResidueSelector's copy constructor needed more than an added
initializer: it set use_input_set_selector_ and then called
set_input_set(), which resets that flag to false, so a copy of a
selector-driven instance always fell back to the (empty) input set. It
is now a plain member-wise copy.
AbrelaxApplication::trRosetta_cst_generator_ is declared under
#ifdef USE_TENSORFLOW, so its initializer carries the same guard.
Each new initializer is placed in declaration order so no -Wreorder
warning is introduced.
Detector hits that were verified as deliberate are left alone: caches and
scratch state (Energies::nblist_, RigidBodyPerturbMover::rb_delta_,
GraftSwitchMover::orig_pose_), observer links, back-pointers to an owning
object, const members that a copy-assignment cannot write (the pcs*
PseudocontactShiftData family), and classes whose copy body re-derives the
members through initialize() or a copy_* helper.