https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98677
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- I don't think the use-after-move is the problem, because only the members of the _State_base class are accessed after the move, and they are unaffected by the move. The move constructor does this: _State(_State&& __rhs) : _State_base(__rhs) { if (__rhs._M_opcode() == _S_opcode_match) new (this->_M_matcher_storage._M_addr()) _MatcherT(std::move(__rhs._M_get_matcher())); } So the _State_base::_M_opcode, _State_base::_M_alt and _State_base::_M_next members of __rhs are not modified, and can be safely accessed after the move.