As the PR points out, we aren't qualifying calls to __ref_cast, and have 'constexpr' on function templates that can never be usable in constant expressions. This fixes it, and also simplifies __variant::__erased_dtor by using std::_Destroy, although that requires including quite a lot more code, for iterator_traits and allocator_traits. If that matters (probably not) then could be split up to move _Construct and _Destroy to a new . Or maybe I should just leave __erased_dtor alone (apart from qualifying the __ref_cast call). Anybody feel strongly either way? PR libstdc++/80939 * include/std/variant (__erased_ctor, __erased_assign, __erased_swap) (__erased_hash): Remove constexpr specifier and qualify calls to __ref_cast. (__erased_dtor): Remove constexpr specifier and use _Destroy.