https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77987
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Seems simple enough to fix: @@ -608,8 +608,9 @@ > >> void - reset(_Up __p) noexcept + reset(_Up __ptr) noexcept { + pointer __p = __ptr; using std::swap; swap(std::get<0>(_M_t), __p); if (__p != nullptr)