https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89816
--- Comment #6 from Antony Polukhin <antoshkka at gmail dot com> --- The fix seems pretty trivial: in function `__variant_construct` get the address of the sorage before entering the `__do_visit` and make it switch only by the `__rhs`. Pseudo-code: template<typename... _Types, typename _Tp, typename _Up> void __variant_construct(_Tp&& __lhs, _Up&& __rhs) { __lhs._M_index = __rhs._M_index; void* storage = std::addressof(__lhs._M_u); __do_visit([storage](auto&& __rhs_mem) -> __detail::__variant::__variant_cookie { using _Type = remove_reference_t<decltype(__rhs_mem)>; ::new (storage) _Type(std::forward<decltype(__rhs_mem)>(__rhs_mem)); return {}; }, __variant_cast<_Types...>(std::forward<decltype(__rhs)>(__rhs))); }